Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Docmd.OutputTo Not Exporting Subreport

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,207
0
0
US
This one has me dumbfounded...

I have a report (cover page) that is used for various databases. The varying or database specific report sub report is placed on this Main report.

Yhe main report can be print previewed look fine, manually exported to PDF and still look fine but when exported via docmd.outputo, the subreport is not present.

The bizarre thing about this case is the same subreport is used with a different main report and works fine. This and other things noted below suggest it is likely the main report at issue.

The below code excerpt is how it is run.
Notably varOutputFormat is passed in and is equal to acFormatPDF

Code:
  'DoCmd.OpenReport strReport, acViewPreview
  DoCmd.OutputTo acOutputReport, strReport, varOutputFormat, strFile
  'DoCmd.Close acReport, strReport, acSaveNo

I tried it with the lines uncommented and still no luck.

I made sure my windows default printer was set to something that normally works and that the reports printer is set to default printer.
I ran the database through my process that exports all the non-table objects to text files and reimported the tables and then the text files to eliminate corruption issues.
The width of the subreport matches the main report and subreport control.
The subreport while having data in grouping headers has no detail section display. It does have a height greater than 0 and Can shrink set to yes. (This seems to crash Access 365 in some cases, part of the kitchen sink)

Playing with it, I set the detail section background where the subreport is and that color is not showing in the exported version nor if I add data in the main report.
It seems like it is just killing the detail section altogether. The detail section and all the controls in it are set visible.

The only thing novel about these reports is they have on open events that set the recordsource to a SQL statement 'passed' via a Tempvars specific to each. This however works countless other places.

I've run out of good and bad ideas... Please share yours.

 
Printout would print it though... I'd still have to name the file using the Adobe Printer.

No the report is not taking longer to open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top