Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How can remove space between cell and HtmlTablecell template #7

Closed
molaie opened this issue Mar 6, 2019 · 2 comments
Closed

Comments

@molaie
Copy link

molaie commented Mar 6, 2019

How can i remove extra space between a cell and html genereated cell?
view attached image.

tried this code, but nothing happens:

				 columns.AddColumn(column => {
				 column.PropertyName("User");
				 column.CellsHorizontalAlignment(HorizontalAlignment.Center);
				 column.IsVisible(true);
				 column.Order(1);
				 column.Width(3);
				 column.HeaderCell("User");
				 column.CalculatedField(list =>
				 {
					 var user = list.GetSafeStringValueOf("User");
					 var photo = list.GetSafeStringValueOf("Photo");
					 var image = string.Format("<img src='{0}' />", photo);
					 return
							@"<table style='width: 100%; font-size:9pt; border: 1px solid khaki; border-collapse: collapse;'>
											<tr>
												<td align='center' style='border: 1px solid khaki; border-collapse: collapse;'>" + user + @"</td>
											</tr>
											<tr>
												<td align='center' style='border: 1px solid khaki; border-collapse: collapse;'>" + image + @"</td>
											</tr>
								   </table>
								 ";
				 });
				 column.ColumnItemsTemplate(template =>
				 {
					 template.XHtml();
                                             //added this, but no sucess.
					 template.BasicProperties(new CellBasicProperties {
						 CellPadding = 0f,
						 PaddingBottom = 0f,
						 PaddingTop = 0f
					 });
				 });
			 });

image

@molaie
Copy link
Author

molaie commented Mar 9, 2019

Any idea or sample?

@VahidN
Copy link
Owner

VahidN commented Mar 9, 2019

  • It doesn't apply zero values, because it makes all of the reports very ugly!
  • If you don't like its defaults, create a new XHtmlField and then apply your custom formatting to the final returned cell. To use this new custom class, try
column.ColumnItemsTemplate(template =>
{
    template.CustomTemplate(new MyCustomXHtml());
    //template.XHtml();
});

@VahidN VahidN closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants