Extending Reports before Rendering
Extending Reports before Rendering
Hi,
is it possible to extend a report after loading and before rendering? I have to place an emf-stream in a form after loading the mrt-file. This has to be done by the program, not using the designer. Is there a possibility to do this?
thanks in advance
Andi
is it possible to extend a report after loading and before rendering? I have to place an emf-stream in a form after loading the mrt-file. This has to be done by the program, not using the designer. Is there a possibility to do this?
thanks in advance
Andi
Extending Reports before Rendering
Hello Andi,
Thank you.
For example:zreptil wrote: is it possible to extend a report after loading and before rendering? I have to place an emf-stream in a form after loading the mrt-file. This has to be done by the program, not using the designer. Is there a possibility to do
Code: Select all
report.Load("report.mrt");
Image image = report.GetComponentByName("Image1") as StiImage;
image.Image = image123;
report.Render();
Extending Reports before Rendering
Hi Jan,
thanks for the quick reply. Unfortunately this doesn't help with my problem. I need to know how to place an emf-stream as a new component in a report. this has to be done so that the emf covers the whole page and lies in the background. i thought about something like this:
stream contains the emf.
report.Load("report.mrt");
StiImage img = new StiImage();
img.GetImageFromStreamOrSimilarMethod(stream);
report.InsertImageAsBackground(img);
report.Render();
in this example i need to know the correct Methodnames for GetImageFromStreamOrSimilarMethod and InsertImageAsBackground.
thanks for the quick reply. Unfortunately this doesn't help with my problem. I need to know how to place an emf-stream as a new component in a report. this has to be done so that the emf covers the whole page and lies in the background. i thought about something like this:
stream contains the emf.
report.Load("report.mrt");
StiImage img = new StiImage();
img.GetImageFromStreamOrSimilarMethod(stream);
report.InsertImageAsBackground(img);
report.Render();
in this example i need to know the correct Methodnames for GetImageFromStreamOrSimilarMethod and InsertImageAsBackground.
Extending Reports before Rendering
You could use the Watermark property of a report page. This way the image will be in the background for the entire page.
Something like:
Something like:
Code: Select all
report.Load("report.mrt");
Stimulsoft.Report.Components.StiPage page = report.Pages[0];
page.Watermark.Image = emfImage;
//page.Watermark.ImageStretch = true;
//page.Watermark.AspectRatio = true;
report.Render();
Extending Reports before Rendering
Hi Brendan,
thanks for the reply. But this is not enough for my needs. I need to place more emf-streams in the background of the report. The watermark can only contain one image. So i think i have to add an image to the components of the page.
thanks for the reply. But this is not enough for my needs. I need to place more emf-streams in the background of the report. The watermark can only contain one image. So i think i have to add an image to the components of the page.
Extending Reports before Rendering
At last i found a way to have an emf-stream in my report.
StiPage page = _report.Pages[0];
StiImage img = new StiImage();
img.Image = StiImageConverter.BytesToImage(StiMetafileConverter.MetafileToBytes(new System.Drawing.Imaging.Metafile(emfStream)));
img.Left = 0;
img.Top = 0;
img.Width = page.Width;
img.Height = page.Height;
img.Name = string.Format("Emf{0}", page.Components.Count);
img.Parent = page;
page.Components.Insert(0, img);
This does the job
StiPage page = _report.Pages[0];
StiImage img = new StiImage();
img.Image = StiImageConverter.BytesToImage(StiMetafileConverter.MetafileToBytes(new System.Drawing.Imaging.Metafile(emfStream)));
img.Left = 0;
img.Top = 0;
img.Width = page.Width;
img.Height = page.Height;
img.Name = string.Format("Emf{0}", page.Components.Count);
img.Parent = page;
page.Components.Insert(0, img);
This does the job
