I have a spreadsheet created with importrange functions that pulls data from another file. The problem I'm facing is that when I try to print out the spreadsheet and save as pdf, the pdf includes all the cells I've set up to receive my data, the empty ones too, and I end up with a 4 page pdf with 3 empty pages.
I tried to put a filter() function in front of the importrange, so that if the importrange somehow imports null values and puts them in the empty cells making them no empty even though they look like it, that would do it, it didn't. I've also read that google spreadsheet interpretes white background color as fill color, and to set it back to default background, and I did, but it didn't solve it. I've removed the importrange functions at all to see if it was that that was doing it, it wasn't. Finally, I've thought about formatting, because those cells are formatted with white borders, but I removed all custom borders and it still prints out all the cells.
To reiterate, I need to be able to do print > save as pdf and get a pdf that contains only the cells used, and I have an old spreadsheet that I'm improving upon that does exactly this (that is not made by me) and has very similar formatting, so I don't understand what's the issue here.
CodePudding user response:
Here's one workaround:
- Select the cells you want to include in your PDF
- Click on "File" > "Download" > "PDF"
- When the Print Settings/Export window appears, select "Selected cells" instead of "Current sheet" under "Export" in the top right corner
This screen capture shows the window in question.
CodePudding user response:
Bois, I figured it out. It's a pretty dumb thing, but I didn't know it.
The solution is absolutely no formatting of any kind, it's ok to have formulas that dont output anything, and custom text color for the cell, but all the cells must be separated and with default background color and default border color (AKA no border option).
What kept bugging me is the fact that my reference project had no cell borders and it had this loong table that never printed out if not necessary, and I assumed it had white borders, but it didn't. Turns out the option to hide cell borders (VIEW > SHOW > GRID LINES) at all is connected to the spreadsheet itself, not the user, so if you disable it, everytime you open the file, from every account connected, it is not gonna show, so that's how they did it.