Crystal Report Layout issue - c#

I am designing a Crystal Report in Visual Studio 2012 and can't seem to manage the position of a vertical line. I need the line to stick the right edge of the page, but it resists. Even if I managed to align it on the right, it displays at a different position after deploying the software on another machine, even when just previewing.
Setting the page size to A4 doesn't help. How can I make this easier on me?
Designer View:
In Report preview the right hand side line is not shown properly:
If I move the line a bit to the left, like this...
...the row background goes beyond the line in preview.

You might have better luck using a Box object for the outer layers and only using lines for the inside columns. Just like the lines, the Box can span multiple sections and will resize vertically if the report has extra lines added in. At the very least this will make sure the outside borders always connect perfectly.
If you're still having problems with precision, try setting the Size and Position. Set the Left and Top to zero, and calculate the appropriate Width value based on the Width of your report.
In the end Crystal reports are a little finicky when it comes to layout, and different viewers/printers might jostle stuff around a little. But unless the report has a dynamic width, you should be able to get it pretty close with a Box and very specific Size/Position values.

Related

Can you allocate space at the bottom of a .NET Chart Control

I'm using the .net chart control. I'd like to allocate some space at the bottom of the chart to add some additional information (date, associated file name, note, etc.) - about 0 to 4 lines in total. To do this I'd like to allocate some reserved space below the X axis title (the 0 to 4 lines worth) and use an annotation anchored to the bottom to contain the additional information. Or, if there's some other way to accomplish the same thing, that would be great.
I've been working for a couple of days trying to accomplish this but have not found a "professional" way to do it. I am able to do it by adding several blank lines to the X axis label, but I'd like something a little better than that.
I am using a dock style of fill and allowing auto sizing. I've tried margins and padding with no success. Annotations appear to simply overlay existing area on the chart but do not allocate any additional space.
I'm looking to allocate a fixed size block at the bottom since the text block will be a fixed size height, rather than a percentage (relative coordinates).
Does anyone have any suggestions that I might try? Thanks!
I found a way to accomplish what I was looking to do. I simply used a chart Title and docked it to the bottom of the chart. It allows me to add in the extra data that I wanted to add and space is properly allocated for it. I'm new to using MSCharts and hadn't noticed that I could use multiple titles docked to different places on the chart.

Top-docking controls more than 32768 pixels

I have a WinForms application that allows you to edit documents. Each document is made of chapters and each chapter holds a collection of RTF blocks. The RTF blocks are loaded in a PanelControl using Dock = DockStyle.Top.
The problem is that when the total height of a chapter gets too large (estimating > 32768 pixels) the lower blocks are not properly docked: they appear behind one another. When trying to isolate the problem I noticed that this also happens with simpler controls like a LabelControl.
Things I tried are methods like Refresh(), Invalidate() and PerformLayout: they will not resolve the issue.
What does help is resizing the form. After that all controls are laid out correctly.
Can anyone help on how to solve this without resizing the form?
Attached a simple demo-project that illustrates the problem.
From my comment above (seems really to be the problem here):
WinForms (and the GDI in general) is often behaving unpredictably if one tries to use coordinates outside a 16 bit range. Try to avoid that. In the range of possible problems are things just not getting drawn at all, OverflowExceptions at unexpected code positions etc.
If it's possible to you take decision to change this layout, I suggest you to take another approach on showing/editing the documents chapters with some kind of pagination or collapsing RTF blocks into a menu and showing only current.
You see.. it makes a sense the height value be a integer 16-bit value.
A screen is way more tiny than this.
As panel height increases to such a high size. You see that using scroll bar will become very very sensible.. and it's not a good thing.
Content with size 2x, 3x, 5x being scrolled is usable to user. But scrolling a content with height (~32768) of at least (using good resolution monitor w/ window maximized) in optimal case 32x the size of window is very uncomfortable.
Plus, I believe that the productivity of user will decrease due to brain difficulty in locate "things" in a increasing collection of "things".

ReportViewer 2010 control either prints part of a table on a separate page or prints an extra empty page

I just started using ReportViewer control VS2010 (web, local).
My report is very simple - 4 columns, all fit on a screen fine.
When I click "print" button, the report is printed on 2 pages ( 2 columns on one and 2 on another).
If I change the margins on a page, all 4 pages are printed on the same page but I still have 2nd empty page printed as well.
If report spans across multiple pages (2 for example), with margins changed I get first page, second page is empty, then third page fine and the fourth page is empty.
Any suggestion how to make the report printed without empty pages?
Thank you,
Jenny
In my experience (which has been a painful one...), I found that if the report is printing an extra page it means that somewhere, your margins or page size of the subreports (if you're using any) are not equaling 8.5 X 11 (or whatever size paper you're using). make sure that your your table (i'm assuming that's what you're using?) is in the bounds of a sheet of paper. keep in mind you need take an inch of of each side (if you're using .5" margins [.5" for each side]) to keep the table on one page.
I had the same problem and m.webster's answer was spot on for me.
Check that the SIZE property of the reports BODY is within your REPORTs Pagesize and Margin properties.
In my case, I had set my report to A4 and the properties of the report (click in the grey area of the designed) showed: PageSize: 21cm, 29.7cm. I built my report but printing resulted in content spilling over to a second page.
When I turned on the RULER option, it was immediately obvious that my reports BODY (white content area) was wider that then PageSize of the Reports page size.
When I reduced the BODY's size->width property down to 21cm (after rearranging all my content to allow this resizing) I found there I was still getting the second page problem. A quick change to the reports margins down to 0 resolved this.
The final white space problem I had was an empty page appearing at the end of some of my reports. This was resolved by reducing the height of the reports BODY so that there was no blank space after my content. Because the initial report body appears in a nice portrait layout, I had assumed that it was just representing the final page which was not the case.
Its a bit of a late answer to the problem but I've added it to save someone else the wasted hour of head scratching when using this slightly unintuitive piece of kit.

Can i make columns of my section in crystal report?

i am working in Crystal Reports for VS2010 with asp2.0 .net, can i make the columns of sections, as i have columns of my tables, and i dont want to overlap, as with labels, they overlap some times.
I am not familiar w/ the VS2010 .net interface, but if it is the GUI, you can set insert tab-stops at the desired spacing. The fields will "snap" and anchor to the tab-stop line when you move them. You can shrink/grow each field so that both left and right sides are anchored, constraining that field. You can then take the next field, and anchor it's left side to the right-side tab-stop from the last field, and repeat. When you're through, all fields will be nicely constrained, and you can adjust the placement by moving the tab-stop. The fields will "rubber-band" and grow or shrink w/ the movement of the tab-stops.
This is REALLY good when you need to export to Excel format, and you don't want the CR print engine to include extra lines/columns as it tries to match the "just a little off" layout.
I "think" I need less "air quotes" and more "air guitar".

Crystal Reports - Underlay section overlays lines (drawing object)

I have a problem with CR (version that ships with VS2008). Report has two report headers, one of them is used for watermark (a picture), using the "Underlay following sections" option.
The problem is that, while this picture underlays field objects, it overlays lines in all of the sections (details, report footer etc...).
Any solutions? Help would be mostly appreciated, I'm starting to lose my hair ...
I found "a solution" by replacing the line object with a textbox object, whose one of the borders is set to single. This way, the watermark stays under, and I have my line.
This might be a bug in CR ...
I had a similar challenge, I had an image in Header 'A' which was set to underlay following sections. The challenge was when I built a Header 'B' and drew a box or a line, they were obscured by the image.
(Text boxes worked fine but I needed to draw a box and some lines.)
The work around was I simply put a Sub report into Header 'B' and then I went into the sub report, drew all my boxes and lines and great news, they all appeared as I hoped when I ran the report. I hope this helps somebody else.
R.

Categories

Resources