I'm using Stimul Report to create a report page. The report page shows correctly. I am reading an image for the stimulsoft web report from database.
Result shows many record image show two images on one page. But I want to show each image on a separate page.
This my code
foreach (StiPage page in report.Pages)
{
page.Orientation = StiPageOrientation.Portrait;
page.Margins.Top = 0;
page.Margins.Bottom = 0;
page.Margins.Left = 0;
page.Margins.Right = 0;
page.PaperSize = System.Drawing.Printing.PaperKind.A3;;
page.UnlimitedHeight = false;
page.CanBreak = false;
}
var image = report.GetComponentByName("Image1") as StiImage;
image.CanBreak = true;
1 -
If you want to create one page for each record you can insert Panel in each page.
Set Panel Dock Style property to Fill;
And then place all your page components in it;
Set Panel Border property to All. if you dont want border around your data, you can set borders color to Transparent. but borders is needed for prevention of decreasing panel size.
2 -
Instead of creating one page for each record you can create one page template and use this and pass your list to report.
For break page after each record(Person) you can use GroupHeaderBand and GroupFooterBand.
Place GroupHeaderBand before of record template;
Set headerband Condition property to your Page Number field like PageNumber;
https://i.stack.imgur.com/tcnlT.png
Place GroupFooterBand at end of the record template;
Set footerband New Page After property to True.
https://i.stack.imgur.com/KTq5E.png
These two bands will show for each record and page breaks after each GroupFooterBand.
Related
Having difficulty figuring out how to print the contents of a Join form in BMC Remedy 9.0. Remedy's docs only explain printing Reports, not Join forms. I would like to either be able to print using Ctrl-P or by an internal Remedy process/action link. My Join form contains mostly character fields. Print preview truncates at the first ~20 px of height, despite a page width: 915 px and height: 1000 px. Does anyone know how I can print forms in the browser?
Figured out how to this - if you place all the content inside a Remedy panel object via the WYSIWYG, then you can add a script in the Web Footer to set the document.body.innerHTML equal to the panel's innerHTML. This little trick organizes the elements in a way that makes the page printable using window.print() or Ctrl-P. Be warned, though, that this innerHTML assignment often corrupts or loses properties like child textarea or input values. So you must scrape for these values and append them back to the page before printing.
<div>
<script>
function myPrint()
{
var idTexts = [];
var textareas = document.querySelectorAll('textarea[id][readonly]');
for(var i = 0; i < textareas.length; i++)
{
idTexts.push(textareas[i].id);
idTexts.push(textareas[i].value);
}
var inputs = document.querySelectorAll('input[id][readonly]');
for(var i = 0; i < inputs.length; i++)
{
idTexts.push(inputs[i].id);
idTexts.push(inputs[i].value);
}
//Assume there is only one panel object, so only one .pnl class on the page
var printContents = document.querySelector('.pnl').innerHTML;
document.body.innerHTML = printContents;
for(var i = 0; i < idTexts.length; i++)
{
if(document.getElementById(idTexts[i]))
{
document.getElementById(idTexts[i]).value = idTexts[i+1];
}
}
window.print();
}
/*On page load, I noticed the click event fired for a visible button
without the user actually needing to click.
Will not work unless the button's visibility is set to true (Remedy is a weird creature).
Used the setTimeout to allow time for the initial page load, as the onload event fired too early.
If you don't want this button to appear on the page when it is printed
overlay a transparent image on the button's display properties.*/
document.querySelector('a[ardbn="btnPrintMe"]').onclick = setTimeout(function(){ myPrint(); }, 500);
</script>
</div>
If you still have problems printing, make sure this btnPrintMe button has at least the correct 6 privileges: 1101/-1101, 1102/-1102, 1103/-1103 and the user you are testing this with has the appropriate privileges as well.
I have a RadGrid that has a WebUserControl for each row of the grid to allow the user to edit that row. When I click the edit button to expand the row (this opens up a .ascx control within the grid for that row), it always scrolls to the top of the page. The user then has to scroll down to find the row they selected with the row expanded to begin editing that row.
I found in another post that adding RadGrid1.ClientSettings.AllowKeyboardNavigation = true; prior to data binding the grid helps to maintain scroll position. This kind of works and you only have to scroll down one click of the mouse wheel to find the row to edit; not good enough.
I also have set MaintainScrollPositionOnPostback=“true" on the aspx page.
I also have set on the RadGrid itself under client settings SaveScrollPosition=“true".
What I'd like to see is the page not move at all when the user clicks on edit for the given row. I would like to maintain the scroll position on the page.
Can this be accomplished? If so, how?
I finally figured out why my grid always scrolled to the top. It was my fault. I wanted the user to see any message from the WebUserControl when control pass back to the parent page. The RadGrid1.ClientSettings.Scrolling.ScrollTop = 0; was the issue.
I had the following code listed:
private void DisplayMessage()
{
// Display any messages from RadGrid2 that occurred in WebUserControl
if (!string.IsNullOrEmpty(Convert.ToString(Session["LabelUpdated"])))
{
lblUpdated.Text = Convert.ToString(Session["LabelUpdated"]);
Session["LabelUpdated"] = null;
}
RadGrid1.ClientSettings.Scrolling.ScrollTop = "0";
lblUpdated.Focus();
}
I've since changed it to what is below:
private void DisplayMessage()
{
// Display any messages from RadGrid2 that occurren in WebUserControl
if (!string.IsNullOrEmpty(Convert.ToString(Session["LabelUpdated"])))
{
lblUpdated.Text = Convert.ToString(Session["LabelUpdated"]);
Session["LabelUpdated"] = null;
RadGrid1.ClientSettings.Scrolling.ScrollTop = "0";
lblUpdated.Focus();
}
}
After the change the grid will only scroll to the top when a message is present from the WebUserControl.
I am using telerik reporter and I have set my background image with following code:
this.Style.BackgroundImage.ImageData = System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath(emzaUrl));
When I run the project, background image is not shown in printpreview mode but when I hit print button in reportviewer the background will appear ... I want to show background in print preview mode to allow user to decide what background should he/she use... what is the problem with print preview mode?
I had set background manually through properties window but the problem exist yet...
Answer:
I used water mark at last:
Telerik.Reporting.Drawing.PictureWatermark pictureWatermark1 = new Telerik.Reporting.Drawing.PictureWatermark();
pictureWatermark1.Image = "http://www.telerik.com/images/reporting/cars/NSXGT_7.jpg";
pictureWatermark1.Position = Telerik.Reporting.Drawing.WatermarkPosition.Behind;
pictureWatermark1.PrintOnFirstPage = true;
pictureWatermark1.PrintOnLastPage = true;
pictureWatermark1.Sizing = Telerik.Reporting.Drawing.WatermarkSizeMode.ScaleProportional;
pictureWatermark1.Opacity = 1;
report1.PageSettings.Watermarks.Add(pictureWatermark1);
Looks like the property you are trying to set has been changed overtime and some issue may be still affecting it.
try this:
report.Style.BackgroundImage.ImageData = System.Drawing.Image.FromFile(HttpContext.Current.Server.MapPath(emzaUrl));
For some more reference about this problem you can find some more details here.
Update
I do not know your context because you have not described it. Since your problem may be caused by using a property that is not in use anymore, the answer above is to indicate that the property has been replaced by a new one with reference to the Telerik post detailing the topic.
However, you can add background images to your report in the whole report, in the header section, in the detailed section and in the footer section.
In this picture you can see that I have added the background images in all 4 cases above described.
To achieve the above I have simply used the property of each section adding the picture.
The relevant code generated in the designer.cs of the report is the following:
// pageHeaderSection1
//
this.pageHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Cm(2.5D);
this.pageHeaderSection1.Name = "pageHeaderSection1";
this.pageHeaderSection1.Style.BackgroundImage.ImageData = ((System.Drawing.Image)(resources.GetObject("pageHeaderSection1.Style.BackgroundImage.ImageData")));
this.pageHeaderSection1.Style.BackgroundImage.MimeType = "image/gif";
this.pageHeaderSection1.Style.BackgroundImage.Repeat = Telerik.Reporting.Drawing.BackgroundRepeat.NoRepeat;
//
// detail
//
this.detail.Style.BackgroundImage.ImageData = ((System.Drawing.Image)(resources.GetObject("detail.Style.BackgroundImage.ImageData")));
this.detail.Style.BackgroundImage.MimeType = "image/gif";
this.detail.Style.BackgroundImage.Repeat = Telerik.Reporting.Drawing.BackgroundRepeat.NoRepeat;
//
// pageFooterSection1
//
this.pageFooterSection1.Style.BackgroundImage.ImageData = ((System.Drawing.Image)(resources.GetObject("pageFooterSection1.Style.BackgroundImage.ImageData")));
this.pageFooterSection1.Style.BackgroundImage.MimeType = "image/gif";
this.pageFooterSection1.Style.BackgroundImage.Repeat = Telerik.Reporting.Drawing.BackgroundRepeat.NoRepeat;
//Report1
this.Style.BackgroundImage.ImageData = ((System.Drawing.Image)(resources.GetObject("Report1.Style.BackgroundImage.ImageData")));
this.Style.BackgroundImage.MimeType = "image/gif";
Here you can find a video with the result. If you still have problems, please describe accurately your context (versions, code, type of report if it is in a class library or if it is a trdx, etc..). With the information you have supplied this is the best I could answer.
Alternatively you may try to set a watermark instead of the background picture.
i added new subreport dynamically based on condition to main report ending of the body, my code is
int left=10;
int top=20;
int width=50;
int height=50;
report.ReportClientDocument.SubreportController.ImportSubreportEx("Test", #"C:\test-sub.rpt", report.ReportClientDocument.ReportDefController.ReportDefinition.PageFooterArea.Sections[0], left, top, width, height);
it is working fine to add the sub report but it shows footer left side small image , i can try to increase the above value(height,width) not showing the small image also, when i click the image subreport displayed in another window, but i have to show the full subreport end of the body please help me any one....
Try this to enable 'can grow' property:
Dim obj As SubreportObject = report.ReportDefinition.ReportObjects('Test')
obj.ObjectFormat.EnableCanGrow = True
I am trying to print a multiple-page FlexPrintJob, that includes on the first page, several labels, then a PrintDataGrid. It all prints, except that the PrintDataGrid only prints using half the page on all the pages.
I know it has to do with the labels that I am printing on page 1, because taking them off or hiding them fixes the issue and the grid prints full page all pages.
I have tried various containers around the grid and labels, including VBox, VGroup, Group, and specifying different combinations of height="100%" for some of the containers.
Is it simply not possible to print a half page of variables / labels on page 1, then start the data grid on the same page (half page worth), but then have it go to full page on the following pages?
Here is my print job code:
var printJob:FlexPrintJob = new FlexPrintJob();
if (printJob.start()) {
var thePrintView:printViewEventUser = new printViewEventUser(); // Create a FormPrintView control as a child of the application.
addElement(thePrintView);
thePrintView.width=printJob.pageWidth;
thePrintView.height=printJob.pageHeight;
thePrintView.parentEncounter=parentEncounter; //pass in my object for the labels to print
thePrintView._currentRec=_currentRec; //pass in my object for the labels to print
thePrintView.myDataGrid.dataProvider = bedSearchEditList._recs;
thePrintView.showPage("single"); // Create a single-page image.
if(!thePrintView.myDataGrid.validNextPage) // If the print image's DataGrid can hold all the data provider's rows, add the page to the print job.
{
printJob.addObject(thePrintView,FlexPrintJobScaleType.NONE);
}
else // Otherwise, the job requires multiple pages.
{
thePrintView.showPage("first"); // Create the first page and add it to the print job.
printJob.addObject(thePrintView);
thePrintView.pageNumber++;
while(true) //queue pages
{
thePrintView.myDataGrid.nextPage(); // Move the next page of data to the top of the PrintDataGrid.
thePrintView.showPage("last"); // Try creating a last page.
if(!thePrintView.myDataGrid.validNextPage) // If the page holds the remaining data, or if the last page was completely filled by the last grid data, queue it for printing. Test if there is data for another PrintDataGrid page.
{
printJob.addObject(thePrintView,FlexPrintJobScaleType.MATCH_WIDTH); // This is the last page; queue it and exit the print loop.
break;
}
else // This is not the last page. Queue a middle page.
{
thePrintView.showPage("middle");
printJob.addObject(thePrintView,FlexPrintJobScaleType.MATCH_WIDTH);
thePrintView.pageNumber++;
}
}
}
removeElement(thePrintView);
}
printJob.send(); // Send the job to the printer.
My print view object is basically just an around my labels, then a PrintDataGrid.
If I remember correctly I fixed a similar situation in the past specifying a minHeight property to my mx:PrintDataGrid like this..
<mx:PrintDataGrid id="printViewDataGrid" width="100%" minHeight="500">
...
</mx:PrintDataGrid>
Good luck!