Posted 14 February 2020, 3:37 am EST
Hi,
I’m experiencing a weird report file size issue which after exploring noticed it was due to the usage of “.substring()” inside of the textbox value tag.
On my report I have 96 textboxes all with code similar to this:
<Textbox Name="TextBox33">
<DataElementOutput>NoOutput</DataElementOutput>
<Height>0.1653646cm</Height>
<Left>2.54615cm</Left>
[b] <Value>=iif(ReportItems![TextBox179].Value.substring(5,1)="1","N")</Value>[/b]
<Style>
<BackgroundColor>=iif(ReportItems![TextBox178].Value.substring(5,1)="1","DarkGray")</BackgroundColor>
<FontFamily>Arial</FontFamily>
<FontSize>4pt</FontSize>
<FontStyle>Normal</FontStyle>
<FontWeight>700</FontWeight>
<PaddingBottom>0pt</PaddingBottom>
<PaddingLeft>0pt</PaddingLeft>
<PaddingRight>0pt</PaddingRight>
<PaddingTop>0pt</PaddingTop>
<TextAlign>Center</TextAlign>
<VerticalAlign>Middle</VerticalAlign>
<BorderColor>
<Default>LightGray</Default>
</BorderColor>
<BorderStyle>
<Bottom>Solid</Bottom>
<Left>Solid</Left>
<Right>Solid</Right>
</BorderStyle>
<BorderWidth>
<Default>0.5pt</Default>
</BorderWidth>
</Style>
<Top>0.1653646cm</Top>
<Width>0.2272cm</Width>
<ZIndex>112</ZIndex>
</Textbox>
Both TextBox179 and TextBox178 represent 2 different bitarrays of 96 values.
The logic is simple:
If TextBox178 bit at position x is 1 use DarkGray as background color.
If TextBox179 bit at position x is 1 use N as a value (text).
If I replace the code and instead of =iif(ReportItems![TextBox179].Value.substring(5,1)=“1”,“N”) I use [b][b] or even [b]N[b] (to display Ns in all 96 text boxs) I get a ~3mb file for a report with 47 pages.
But If I use that substring which is inside of the tag I still get the same 47 pages report but with a file size of ~52mb.
Is there a .substring() replacement like .findAtChar(index, value)? What could be the cause of this massively increase in size?
Thanks in advance.
Best Regards,
Ricardo Pereira