Skip to main content
September 20, 2023
Solved

Center page header blank after exporting report to Excel

  • September 20, 2023
  • 1 reply
  • 0 views

Yesterday our QB Desktop 2021 quit entering information in the center of page headers on reports exported to Excel.

 

I've updated QB and Excel 365 (which was already up-to-date).  I've run Quick Fix My File, Quickbooks File Doctor, Quick Fix My Program, and Quickbooks Program Diagnostic Tool.  I've restarted the PC several times.  Nothing has corrected this.

 

I will include screenshots of a report from last month and from today to illustrate.

 

Lisa Kelly

Best answer by BigRedConsulting

First Presbyterian Church of Moncks Corner

6630 WORSHIP/EVANGELISM/FELLOWSHIP

January 1 through October 13, 2023

 

I believe this is the same report as the screenshot.

 

Lisa


With your text I was eventually able to reproduce the issue here.

 

The problem is that the length of the Excel worksheet header fields is limited to 255 characters total (left, middle, and right section lengths combined).

 

So, if QuickBooks tries to set the header where the text is longer, it fails. It may be trying to do that, or it may notice the text is too long and not even try. However, either way it doesn't tell you that the header couldn't be set.

 

I was able to reproduce the issue only after changing the default fonts for the various fields in the header and by picking fonts with long names. Changing the fonts broke it because the font names are actually written to the header and then Excel converts that encoding to display the text using those fonts.

 

Here's an example of what's actually written to the excel header using your text and some fonts I chose:

&"Bookman Old Style,Italic"&12 First Presbyterian Church of Moncks Corner
&"Lucida Sans Unicode,Italic"&14 6630 WORSHIP/EVANGELISM/FELLOWSHIP
&"Bookman Old Style,Italic"&11 January 1 through October 13, 2023

 

The text above, including carriage returns, is 209 characters long, which actually fits.

 

BUT, if the left header is also set and includes the default prep date, time, and basis fields, then the left header will look something like this internally, depending on your font:

&"Arial,Bold"&8 9:16 AM
&"Arial,Bold"&8 10/13/23
&"Arial,Bold"&8 Accrual Basis

 

Using the font Arial Bold it is 80 characters long.

 

And, 80 + 209 is... too long. And so the center header isn't set to anything - either because QuickBooks doesn't try or because it does try and it ignores the resulting 1004 error that Excel returns in this case.

 

I'm not sure what your fonts are for these various header fields, but if they have long names then using fonts with short names may help, and if you remove one or more of the left header fields from the report before sending it to Excel, then it should work much more reliably.

 

For example, when I set every field to Arial and used your text, it just barely works. When I did that, I got this result in the header fields:

&"Arial,Bold"&8 9:56 AM
&"Arial,Bold"&8 10/13/23
&"Arial,Bold"&8 Accrual Basis
&"Arial,Regular"&12 First Presbyterian Church of Moncks Corner
&"Arial,Regular"&14 6630 WORSHIP/EVANGELISM/FELLOWSHIP
&"Arial,Regular"&11 January 1 through October 13, 2023

 

The combined text above is 254 characters long, and so there is room for just one more character!

That single character could get used up if the time was four minutes later: 10:00 AM.

Worse, if you chose a different date format for the date, such as "October 13, 23", then it would fail as the resulting header would be way too long. Or, if the auto-generated date range text, "January 1 through October 13, 2023",  was longer, then it would also fail. For example, "February 1 through February 28, 2023" is two characters longer, and so would cause the failure.

 

So, the best way to make this work reliably is to change your reports so that far less text is written to the header, so that you're not close to the limit of 255 characters. You can do this by removing fields from the report header, using fonts with short names, and by shortening your text.

 

Hope this helps!

1 reply

BigRedConsulting
September 23, 2023

As you export, there's a setting that controls this:

 

 

If you click Advanced as you export the report to Excel, then if you have the first option selected as shown above, you won't see the title unless you print the report.

 

If you click the second option, then you'll see the title on the worksheet just like your 'before' example.

 

Is this what you're seeing?

LochkellyAuthor
October 4, 2023

I have tried that by setting it, unsetting it, and over again.  No affect.

 

Thanks for trying.

 

Lisa