cancel
Showing results for 
Search instead for 
Did you mean: 

Subreport truncation

Former Member
0 Kudos

Hello,

I have a report that has 4 subreports (the same subreport imported 4 times) in it, which are dynamically arranged/showed/hided during runtime. The problem is that the subreport has many records, it is expanded to multiple pages (7-8 pages) and time to time some records are missing. For instance I have the record with number 540 in the end of the page. After it I have to have the record with number 545. The numbers aren't chronologically because I have some filters applied. The space between the record 540 and the page footer section may permit to have there the record 545, but suddenly it disappears. And in the next page I have the record 560. The order should be 540, 545, 560.

This problem doesn't appear every time. For instance is possible to have the first 4-5 good pages and the missing to appears in page 6, or to have the missing in the first page, or to have the whole report correct. The situation differs.

I found a workaround. During runtime, if I export the report as .rpt file, with data in it, it seems that the records are displayed correctly. It seems that the export computes correctly the space needed to display the last record in each page.

I attached a printscreen to see how the missing record appears in the exported version. The left side has the report generated during runtime and the right side has the exported .rpt file and then loaded in a report viewer.

I don't have any clue why the subreport is truncated when page changes. The workaround is a little bit weird. I would like to have the report generated correctly during runtime.

The report is now edited using Visual Studio 2013. Can be a problem that it is created in a version prior to 2013? Should I convert it to a newest version?

PS: sorry for my English. I hope I explained well.

Thanks in advance,

Gabi

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Gabi,

Page formatting is dependent on the printer you are using. Try No Printer and then try a different printer.

Do not use Windows XPS print driver, it has multiple problems....

If that doesn't work then is it possible to include the report with saved data so I can test?

If you cannot attach the report here, use the Advanced editor and add a .txt extension before attaching, then do you have a support contract and create a case in Service Market Place to attach the report to?

Don

Former Member
0 Kudos

Hi Don,

I designed the report using No Printer. During runtime, my default printer is pdf creator.

I attached the original report and the exported one. The original report is rearranged during runtime. This problem with missed records is here from the version 13.0.0.x of the crystal reports. I suppose is a bug, or maybe we have to follow an order in code to arrange the report and then to set the datasource for the subreports, or to force a refresh for the report after the rearranging, I don't know... The datasource is set from code, the report doesn't connect to the database.

Thanks,

Gabi

0 Kudos

Hi Gabi,

Thanks for the reports. I found a potential cause, there are 13 errors in your forumlae which may be causing the formatting problems.

In the exported report those fields do not exist in the data source.

When CR SDK opens a report it checks all objects, in this case the field references in the formula do not exist in the Data source.

So I don't know how you are setting the XML source at runtime or what they look like as compared to when the report was designed but CR is expecting those fields to exist in the XML, even if the data is blank it does not matter, they still need to be defined in the XSD portion of the XML file.

Likely what is happening is the formatting engine runs into those fields and can't resolve what to do next.

Fix them first and then test again:

Engine Subreport count: 4

Subreport Name: GrapActiuni1.rpt

Formula: @F1 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'{GQTMPActiuniP.COL1}'

This field name is not known.

Details: errorKind

Formula Text: {GQTMPActiuniP.COL1}

End of Subreport Formula: Subreport1

Formula: @F2 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'{GQTMPActiuniP.COL2}'

This field name is not known.

Details: errorKind

Formula Text: {GQTMPActiuniP.COL2}

End of Subreport Formula: Subreport1

Formula: @F3 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'{GQTMPActiuniP.COL3}'

This field name is not known.

Details: errorKind

Formula Text: {GQTMPActiuniP.COL3}

End of Subreport Formula: Subreport1

Formula: @F4 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL1}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL1}),2,".")

End of Subreport Formula: Subreport1

Formula: @F5 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL2}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL2}),2,".")

End of Subreport Formula: Subreport1

Formula: @F6 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL3}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL3}),2,".")

End of Subreport Formula: Subreport1

Formula: @F7 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL13}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL13}),2,".")

End of Subreport Formula: Subreport1

Formula: @F8 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL4}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL4}),2,".")

End of Subreport Formula: Subreport1

Formula: @F9 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL14}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL14}),2,".")

End of Subreport Formula: Subreport1

Formula: @F10 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL5}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL5}),2,".")

End of Subreport Formula: Subreport1

Formula: @F11 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL15}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL15}),2,".")

End of Subreport Formula: Subreport1

Formula: @F12 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL6}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL6}),2,".")

End of Subreport Formula: Subreport1

Formula: @F13 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'CStr(CDbl({GQTMPActiuniP.DCOL16}),2,".")'

This field name is not known.

Details: errorKind

Formula Text: CStr(CDbl({GQTMPActiuniP.DCOL16}),2,".")

End of Subreport Formula: Subreport1

Subreport Name: GrapActiuni1.rpt - 01

Formula: @F1 : Used: 1 times'End'

Error in formula :

Error in formula  ~:

'{GQTMPActiuniP.COL1}'

This field name is not known.

Details: errorKind

Formula Text: {GQTMPActiuniP.COL1}

Is it possible to get the XML data source before and after the report is exported? I there is a difference... What I need is the original xml file the report was designed with so I can compare after.

If not possible then you check them, they must match 100%.

Also may be how you are formatting the XML, if there are Tables defined then you must set the tables up in the XML and in your Dataset.

Or are you using the XML as the data source?

Need more details about your work flow....

Don

Former Member
0 Kudos

Hi Don,

I checked the exported report. If I open it in Visual Studio I don't see any error in formulas. I attached a printscreen to see how it looks for me. But having errors in formulas doesn't mean that report wouldn't render? I had the situations with errors, on other reports, and for these cases I had a popup with the formula and the error. For the current report I don't have any error when it is rendered. Only that it loses those records.

When I designed the report I used an OLE DB (ADO) connection to a Microsoft SQL Server Express 2005. I also attached a txt file with the structure of the view used in the report datasource and the table from which the view is created.

During the runtime I set the datasource for the subreports with something like this: rpt.Subreports("GrapActiuni1.rpt").SetDataSource(ds) where ds is a vb.net DataSet object. The formulas are set during the runtime like this: subRpt.DataDefinition.FormulaFields("F" & x).Text = "CStr(CDbl({GQTMPActiuniP." & col.MapingName & "}),2,""."")". In the original report formulas are empty.

Thanks,

Gabi

0 Kudos

Hi Gabi,

Does the exported report work for you in CR Designer? I tried setting location and it works for the first 3 subreports but the last one CRD simply goes into not responding every time I try to do something.

Does it happen to have a SQL Expression of did the original have a subreport in it? You cannot insert a subreport that has a subreport in it.

I'll keep trying but bottom line is there is something wrong with this report and/or how you are modifying it at runtime.

Don

Former Member
0 Kudos

Hi Don,

Yes, the exported report works for me in CR Designer, in Visual Studio CR Designer. The first 3 subreports has the datasource sent from code, as vb.net DataSet object, and the last one has the datasource connected to the database. But the last one subreport is placed into a suppressed section. Doesn't this mean that it is suppressed? Not processed?

I don't have any SQL Expression, or subreport in subreport.

I tried many combinations of settings for subreports, sections, textboxes, lines, before to post the question here. I think is  bug in the rendering engine when the detail section from the subreport is measured to be placed into the page or when the subreport object from the page is measured. It seems that the subreport object is truncated even if it has a detail section in the end which may fits before page footer section. The weird thing is that in the exported report, these records appear. Or maybe is something wrong in my report, I don't know.

I think I will use the workaround, to export as rpt file and reopen. This report is used with different configurations and sometime the records are missing, sometime not.

Thanks,

Gabi

0 Kudos

Hi Gabi,

Ah yes, I noticed that also, last subreport is connecting to the data using OLE DB.

I would like to ask DEV to look at this issue. We have seen this before.... and we do consider it serious.

However there have been issues reported using that PDF Creator driver, it has caused problems with paging and we can't fix it, bug in their driver. Even though you are using No Printer CR still queries the default printer for some printer properties when rendering the page.

Can you change the default to any other default printer than the PDF Creator?

Then change the report to use your default printer and preview it to the last page and save it. Close the report and then reopen it change it back to no printer.

Now run it in the app and see what happens.

See if that changes anything.

Also, because I have no data I can't see the problem. Any chance to give me the script to insert the data so I get the exact same results as what you see?

If the script is too big or you can't attach for security reasons let me know and I'll send you an update to contact me directly to get it to me.

Thanks again

Don

Former Member
0 Kudos

Hi Don,

I did what you said about the default printer, but the result is the same.

I can give you the data, but the function that reorganize the original report to be like the exported one is a little bit complicated. Meantime I did another test. I did put the data into a test database (MS SQL Server Express 2005) and bound the exported report to that database. The result seems to be OK. No missing records. So, the exported report works fine with the test data, connected to the database.

Can you tell me if there are some differences between the exported report and the original regarding the page settings, page size, section formats, etc.? I know that the original report is portrait and the final one landscape, but there are other significant changes? When the original report is reorganized to be like the exported one, can be there something wrong with elements format (sections, textboxes)? When the report is exported, did CR render the report using the default printer, or it changes other format settings?

It's strange that the exported report works fine.

Thanks,

Gabi

0 Kudos

Hi Gabi,

Yes there are differences. If you download my printer test app in KBA 2163438 and run it you can see the original report has printer info and the orientation is portrait, exported the orientation is landscape so the page breaks will be different.

And the original report is using crdb_ado.dll for the DB driver and exported report is using crdb_adoplus.dll

Should be update to the use the ADO. NET DB driver as well.

I have not had time to test your report using multiple data sources to see what happens....

Don

PS - I'm off until next Wednesday now...

Answers (0)