Excel print area/formatting issues across different Computers - excel

I programmed a reporting tool in VBA. It does structure some data and then puts together a report. The report only consists of shapes, pictures and charts, i.e. no information is stored in cells.
All elements are either already the report sheet or get positioned by using the .left and .top properties. In the end, the sheet gets exported as a pdf. It is a nice two pager, at least on my computer and a different one I have access to.
However, when a collegue tries to run the code on his computer (exact same Excel version), the output gets distorted. It does not fit on two pages anymore (in height) and some elements (charts and tables inserted as pictures) are not on the exact same positions where they should be.
It looks like the fixed elements that are already on the report sheet are compressed horizontally so that they get to high for the pages (the fit the page width in the output). All the other elements are put where they belong but do not fit the compressed page anymore. I cant show you the real thing, but I made one part of the report unreadable to show it to you. (And I have put red text and arrows to explain the issue)
I dont have access to the computer that produces the flawed output, only to the pdfs it produces.
I have no idea how to solve this problem, as the print area and page properties are defined in the workbook itslef, and should not change. Also .Top and .Left positions should be accurate everywhere.
Maybe somone has experienced something similiar and can give me hint. Thanks.

Related

Change Excel chart legend text entry without editing the data?

I have a Powerpoint presentation that I need to refine and it includes some charts from Excel (I did not make them). However, those charts were copypasted and the originals are no longer available - but some legend text entries are wrong because the data were modified in the meantime. Is there a way to change ONLY the entries without going on Excel and selecting the data? Basically doing it visually in some way? The data on Excel are still the same, it's only the name of the series the charts refer to that has changed, but doing the charts from scratch all over again would require quite a lot of time because the format of the original Excel tables is now completely different.
Essentially the charts are just fine, the colours are also fine, it's just one legend entry that is wrong.
Copy as an image then edit using a picture editor.
But how was the data updated as you state it was modified then you say the data is still the same.
You could even make a dummy chart and create the legends in the correct font and size, then copy those and paste on the original image, done with an eye for detail and it won't be noticeable.

Printing Long Spreadsheets on One Page (Excel to PDF)

I have a time based chart and I am trying to print it on one pdf page. The chart spreads from column 'B' to 'UR' ~ 560 columns. I have the print setup for that area and to fit one page. It prints till column JU and disregards the rest. Not sure if there is a work around or if I am missing something. And if there is a vba script that can help with it.
I tried some additional variations and did experience the cut off issue. I couldn't quickly work out what created the limit, but it wasn't the number of columns; a guess is there is a limit to the size of the hidden "canvas" on which the chart is painted before its scaled back to print and/or save as PDF ... hence is related to the width of the chart. However you can see (roughly) from the screen shots below a chart spanning from B to UR (limited by yellow in column UR); the chart is 319cm wide. Then the saved PDF. The page setup was A4 landscape with narrow margins. Cheers.

How to zoom a sheet in revit api?

I wrote an external command that creates detail views for doors, windows, etc and puts each object in a separate sheet.
Sometimes the new sheets are zoomed-out by default (the yellow circle shows the actual sheet).
I guess it has to do with the witness lines (in the blue circle).
Sheet zoomed out
I tried activating the views and then found their uiView and used the zoom methods but they don't seem to make a difference (possibly because they work in model coordinates and not in sheet outline coordinates).
uv.ZoomToFit();
Manual zoom-to-fit works fine.
Also, the sheet's outline property is correct (not too large).
Any ideas?
Thanks!
You can use the ShowElements method to zoom to an element. That does the same as zoom-to-fit to a specific set of elements. The element may possibly also be the sheet itself.
The Building Coder discusses how that can also be used to Switch View or Document.
Also, look at displaying a text file from a TaskDialog command link.

Avoid distortion and wrong scaling of shapes and objects when printing Excel worksheets

Excel distorts shapes ans objects when printing.
A spreadsheet with several objects (Active-X-Radio Buttons and other) and programatically created shapes (Lines, arrows and rectangles as seen above the word 'System') should be printed as such:
Sometimes however, assumingly when the memory is low, excel distorts the layer holding all graphical objects.
In the printout these objects are completely out of size:
The bug occurs randomly and independent of the way, the sheet is printed. Either programatically saved as PDF or manually printed using the print dialog.
Yes, unbelievable, the zoom level of the active window is responsible for this behaviour.
Put Zoom of the excel page at 100% and the pictures are wrong and distorted. Put 99% and it's perfect. It sounds crazy but it works.

How to force a textbox to split, rather than move to a second page in SSRS 2005 (PDF Export)?

This question is a follow up to my original question, I've done a bit more reseach, i narrowed a problem down quite a bit.
I've also uploaded a sample .rdl to illustrate the problem
I've got the following report setup: a header (image in the body), two textboxes, and a footer.
First textbox has a little bit of text, and second textbox has lots of text. Second textbox can fit on one page by itself, but won't fit on the page with my header and the first textbox.
The problem is that for some reason, the second textbox in the report is unaware of other contents of that same report, and as long as that one textbox fits on one page - it will be moved to the second page. (once the textbox grows larger than 1 page - it will split, and will achieve the desired behavior)
Desired behavior is to split the second textbox, and keep as much text on the first page as possible, and move the rest to the second page.
I'm not sure about v.2005 but in v.2008 you can set a textbox property: KeepTogether to false.
This will fit as much text on the first page than the rest on the second page.
This is pretty standard behaviour in SSRS. Like many issues with the Reporting engine, you have to trick it.
In this case you could try to provide the 'lines' for the second text box as individual rows in a Detail, then use a repeater or table to display them. Alternatively you could break on 'paragraph'. Unfortunately you'll have to do this in your data source, probably in a stored procedure, depending on how you're getting the data to the report.
If appropriate you could look at client-side reporting (.rdlc files), which allows you to pre-process the data in a .NET application, although setting up for printing can be more complex.

Resources