Dear Sir!
I have a problem when I want to report page list in project. I have readed many discus in the forum about it. I want "padding text" in file report . I have added :
private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
(sender as XRTableCell).Text = " " + (sender as XRTableCell).Text;
}
or
xrTableCell14.Text = " " + xrTableCell14;
Although I set Padding as below:
But it is not worked.
The format report, Text does not still padding as I want.
Please help me!
Hi Huong. Firstly, to clarify, the use of scripting to add a space to the text is a workaround for the fact that Text On Drawing does not recognize cell padding defined in the report template.
So if you are not intending to use this template for Text On Drawing reports you can simply adjust the Padding values in the report template. Select the cell in the Designer view in Report Template Designer, then look in the Property Grid for the Padding property and adjust as desired.
I just tried
private void OnBeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { (sender as XRTableCell).Text = " " + (sender as XRTableCell).Text;}
and it works for Text On Drawing for me. If it is not working for you, I'm not sure why. Be sure to add the script to the correct cell, which in your case looks like that should be the cell containing the [Page.Fields.Description 001] variable.
I modified file report as your suggest. When I preview report , it is work, padding left. But I report it to new drawing, it does not work as I want, it not padding left.
I send to you file report , Which I design, Please help me check error of it.
I want field : Description 001 is padding left : 20 or space.
Thank Sir very much
I would send you your template in SS5 format but I don't have SS5 installed anymore and I will not have an opportunity to do so very soon. Please upload the latest version of your template (the one with the Before Print script and the Data Binding set to None for the cell in question) using the Communities Secure File Upload method and I will try to see what is wrong.
thank Sir! I uploaded it to that link.
Huong, there does seem to be something unusual about the state of your template. Again, I only looked at it in SS8, but the problem seems to be that although the Data Binding is set to (None), the Page.Description 001 field is somehow "stuck" to the cell. One indication of this is the small cylinder icon in the upper right of the cell; normally an unbound cell would have no such icon.
I was able to fix this two different ways.
Method 1
Method 2
I readed : https://communities.bentley.com/products/electrical___instrumentation/w/electrical_and_instrumentation__wiki/14820/before-print-scripts-for-report-templates.
If the script seems unable to populate the cell or label, try unbinding the Field:
With the cell selected, click the small > button that is revealed above the cell.
On the resulting Table Cell Tasks dialog, clear the Text field and ensure the Data Binding field is set to "None".
Click away from the Table Cell Tasks dialog to dismiss it. The cell selected in step 4 should now have no text in it.
Huong, normally those steps to set the Data Binding to None work, but there is something not quite right with your template and that method did not work for me either. I had to use Method 1 or Method 2 that I described in my previous post in this thread.