Can I fixing control's position in rdlc report C#? - c#

if control's height over one paper size, control move next page...
I want to fix them where I positioning.
if they height over current page, cut over parts and showing next page cutted parts.
like this
does it can?

If you're dynamically building the report from code you can certainly do that.
For a report being built dynamically, you'll need to track the approximate sizes of the page as well as the individual control heights.
If the control would take up more space than the available space on the page, you can enter a page break.
You have complete control on the output if you use GDI+ to generate the report view.
Hope this helps.

Related

Location of an element in a WebBrowser c#

I have a WPF project that loads a WebBrowser property, now I want to know the pixelized location of a specific element in the WebBrowser property, and to focus/zoom to that element in the program, so that the user will be able to see what is going on visually.
How can I do that?
I've found a solution.
Create a panel that includes the WebBrowser control and size the WebBrowser control to its content size (a how to can be found in my last question, here : WebBrowser get page size), so now the WebBrowser control has no scroll in it, but the panel has one (if the panel size is smaller than the current WebBrowser control size).
Next step is scrolling to an element, and the following code does it :
SomePanel.AutoScrollPosition = new Point(SomeWebBrowserElement.OffsetRectangle.X, SomeWebBrowserElement.OffsetRectangle.Y);
And that does it.
Hope it helps those who seek the same thing.
Edit :
P.S.
Some of you might wanna become fancy with the scroll wheels and make it scroll to that the element will be in the middle of the screen, since the location makes it in top left, that's possible too, just use the panel size in order to do that.

Creating a printable form with varying page count and automatic page breaks

I want to create a printable "invoice" form with a varying number of pages. Each page should have a repeating header and footer, and in between are the invoices' positions.
It would be great if WPF could create an automatic page break between the positions. Is that somehow possible?
In another project, I've created a more "static" printable form which consists of a Canvas, exactly in size of a A4 page, with nested Layout frames and controls on it. This canvas can be printed, and it is working great, I like the concept.
But how about dynamically varying content with a varying number of records, and page breaks?
Can this be realized in WPF?
You probably want to look into flow documents. These allow you to create document style content and can be displayed in a few different WPF controls. The FlowDocumentReader control has a "Page" viewing mode that might be what you are looking for. Here are some links to get you started:
Flow Document Overview
FlowDocumentReader Class
There is FlowDocument. But this is exactly the reason of existence of various reporting systems, to let you define something abstract, what then will be split into pages with headers, footers, automatic table splitting, etc.
I'd recommend to use something like PDFsharp (it has Migradoc for this reason). Viewer can be embedded, but much easier to simply run external pdf-viewer, the only task left is to generate pdf itself.

Fix diffrent text amount to web browser content

I have a web browser in my win form
I'm filling it's content with some text for each time(text size in each loop almost the same size).
my web browser size is fixed
i want to aromatically fix my content text to browser content
(for example if my content text size is more than the web browser content with some algorithm fix it to content and do not show scroll)
exactly some algorithm that fix Css for each content size to web browser size
is it possible?(may be some thing like change text size for best fix or ...)
all you really need to do it wrap your text inside some DIV tag, and this will auto encapsulate the text in your DIV to fit the window.
I'm assuming you do not want the horizontal scroll bar, is that correct? Because you haven't specified, I'm just guessing. If it is the vertical scroll bar you do not want, then let me know.
Otherwise, if you're text input is being placed in many different areas, and you really need more global or generalized control over this, you can alter the WIDTH attribute in your BODY tag to ensure it is exactly, or a few pixels smaller than the width of your WebBrowser control.
So if your WB control width is 600, you would place this in your BODY tag of the HTML page you have loaded (i'm assuming you have access to the HTML page, if not, once again, let me know).
<BODY WIDTH="590">
Let me know how you go, and if I've totally missed or misunderstood your question, please let me know and add the details necessary so that we can understand what you need.
Cheers.

A winform with sections that can be resized, and auto-resize

I am creating a C# winform (not asp.net) with two sections.
The left section is a sort of toolbar, where the user will enter a few images to be displayed.
The right section will display the information, the images.
Images can be any size, but the toolbar will almost always be the same size.
I wanted these two sections to be seperate, aka a divider between them, that I can drag about.
As well, any time an image is chosen, the right screen will resize, or at least resize and give me a scrollbar.
How can I accomplish this?
You can use a SplitContainer. You will need to set the FixedPanel property to the panel you want to remain the same size.

Graphical hiccups in C# User Control - Resize obscures components

I'm experiencing difficulty with a custom-made User Control, and my searching on Stack Overflow, MSDN, and Google didn't pop up any troubles quite like the one I'm experiencing.
I have a very simple User Control: It's a label, a text box, and a button, with a SaveFileDialog and a FolderSelectDialog available. The text box and button are anchored Left,Right and Right respectively, with the intent that if the control is resized larger, the text box will enlarge to fill the gap, and the button will stay on the right edge of the control.
The problem I am encountering is that when the control is enlarged, the area to the right of the default width of the control becomes blank space when the project is built and run. The pictures here will illustrate what I mean:
In editor:
Running:
The control is smallish in its design window, but when I add it to a form and widen it, it behaves as intended. However, when I run the form the control was added to, half the control isn't visible.
I suspect that I'm overlooking something fairly straightforward, but I wasn't able to find anything addressing this point in my search. Help would be much appreciated.
My guess is that there is a panel or something that is added to your control and will be brought to front somehow runtime.
from property window's top there's a combo from which you can select all the controls in your User Control.
check if all the controls are what you want.
if you find that panel or anything delete it :)
EDIT:
alright this was not your problem.
now I can only assume that you have set some manual sizes to your user control, i.e. in its constructor. in that case designer will show the correct size of you user control,
now some other place in your code, you have set the user controls size manually again. if the layout is suspended and size changes, I think that the anchored controls' size will not change automatically.
if this is your problem, it is probably hard to find.

Categories