I want the Report Footer to print at the bottom of the page rather than at the bottom of the end of the last line item of the report.
Also I'm formatting this for a paper that has a pre-printed grid on it and in order to make everything fit in the grid, I also have a Page Footer that's a couple inches high. However, I need the Report Footer to print in the Page Footer area.
There is no report footer in the Stimulsoft Reports.
There is a Report Summary where you could set the Pring at Bottom property.
You should set PrintOnAllPages = True in the footer band
StiFooterBand footerBand = new StiFooterBand();
footerBand.Height = 0.5f;
footerBand.Name = "FooterBand";
footerBand.Border = new StiBorder(StiBorderSides.All, Color.Black, 1, StiPenStyle.Solid);
footerBand.PrintOnAllPages = true;
page.Components.Add(footerBand);
Related
I need to add a footer on the MigraDoc.
The following code adds footer to all the pages.
The page has a header which needs to appear on each page.
Document document = new Document();
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(false);
Section HeaderSection = document.AddSection();
HeaderSection.PageSetup.DifferentFirstPageHeaderFooter = false;
MigraDoc.DocumentObjectModel.Shapes.Image image = HeaderSection.Headers.Primary.AddImage("../images/logo.jpg");
image.Height = new Unit(65);
image.Width = new Unit(150);
image.LockAspectRatio = false;
image.RelativeVertical = RelativeVertical.Line;
image.RelativeHorizontal = RelativeHorizontal.Margin;
Paragraph ParaHead1 = HeaderSection.AddParagraph();
Parahead1.AddFormattedText("..dfg");
Table table = HeaderSection.Footers.Primary.AddTable();
table.Borders.Width = 0;
Column column = table.AddColumn();
column.Width =Unit.FromPoint(300);
column.Format.Alignment = ParagraphAlignment.Left;
Column column1 = table.AddColumn();
column1.Width = Unit.FromPoint(200);
column1.Format.Alignment = ParagraphAlignment.Left;
Row row = table.AddRow();
Cell cell = row.Cells[0];
cell.AddParagraph("Regards,");
cell = row.Cells[1];
Paragraph para1 = cell.AddParagraph();
para1.AddFormattedText("Support Team");
I need the footer table to appear only on the last page.
I don't want add to add the last paragraph as the table as the footer as that will cause the footer to appear just appear the text.
The content on the page is dynamic.
You cannot use the MigraDoc footers for a footer on the last page only.
To achieve this effect, you have to add the text to the main body - or draw the footer later using PDFsharp.
You can use a TextFrame to have the footer at a fixed location, but you must take care that the TextFrame will not overlap with other main body content.
To answer the question from the comment:
To have the "footer" directly below the content, just add it to the main body in any form you like (table, paragraph, ...)
To have the footer at an absolute position (e.g. using a TextFrame): I recommend adding an empty dummy paragraph to the main body text (if needed) to make sure the footer does not overlap with the main body; the height of the dummy paragraph will be the height of the footer that overlaps with the main body area of the document
The approach I used was to add a flag to PageSetup within a Section.
The flag tells the engine to replace last page header and footer with the ones specified by the LastPageHeader and LastPageFooter keywords.
This is an example of section supporting last page header and footer ( it uses a special Migradoc/xml syntax, but it's supported with the original mddl as well):
<Section>
<Attributes>
<PageSetup PageHeight="29.7cm" PageWidth="21cm" Orientation="Portrait" DifferentLastPageHeaderFooter="true"/>
</Attributes>
<LastPageHeader>
....
</LastPageHeader>
<LastPageFooter>
....
</LastPageFooter>
</Section>
A fork supporting this functionality is available here: https://github.com/emazv72/MigraDoc
Note that LastPageHeader and LastPageFooter only work with PDF, not with RTF.
the large glyph all on the left . small glyph on the right with vertical allignment.
all the button are generated on the code.
this is my code using c# for winform showing
RibbonPageGroup pagGroup = new RibbonPageGroup();
BarButtonItem barButtonItem = new BarButtonItem();
pagGroup.ItemLinks.Add(barButtonItem);e
You should add your bar item links into PageGroup one by one. For small items use the BarItemLink.BeginGroup property to separate all the next items into button group:
// ribbonPageGroup1
ribbonPageGroup.ItemLinks.Add(barButtonItem1);
ribbonPageGroup.ItemLinks.Add(barButtonItem2);
ribbonPageGroup.ItemLinks.Add(barButtonItem3, true); // begin group
ribbonPageGroup.ItemLinks.Add(barButtonItem4);
ribbonPageGroup.ItemLinks.Add(barButtonItem4);
Use the BarItem.RibbonStyle propety to specify display options for specific bar items:
barButtonItem3.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText;
In a flextable I create rows with buttons in the first column showing the number of each row, and textboxes in other columns.
I would like to reduce space between rows to a minimum.
var btnField = app.createButton(numRow).setId(fieldId).setSize(20, 20)
.setStyleAttribute('marginBottom', 3).setStyleAttribute('marginTop', 0)
.setStyleAttribute('fontSize', 8).setText(numRow));
flextable.setCellSpacing(1).setCellPadding(1); //Minimum distance between rows ??
Problem regarding the buttons is that the texts are not in the middle of the buttons vertically. I cannot reduce the size of the buttons (using .setSize(20, 18) or so) as text will become outside the buttons at the bottom.
What styleattributes should I use to position the text of the buttons in the middle of the buttons vertically, right alligned with a small marginRight? The buttons itself should not exceed the size of the textboxes in order to minimize distances between rows.
If I have to use settings on the flextable, that will be OK as well of course.
Style attributes should be written using camelCase, use fontSize instead of fontsize and you'll get this :
which is nicely centered.
edit : I made a few tests on button text alignment and the results are a bit surprising ...
code and illustration below show that only horizontal alignment is doable on text content and that paddingTop applies but has side effects the other widgets as well
function doGet() {
var app = UiApp.createApplication().setTitle('test buttons');
var btn1 = app.createButton('test Button1').setPixelSize(200,60).setStyleAttributes({'fontFamily': 'serif','fontWeight': 'bold','fontSize':'14pt','text-align':'right'});
var btn2 = app.createButton('test Button2').setPixelSize(200,30).setStyleAttributes({'fontSize':'12pt','textAlign':'left'});
var btn3 = app.createButton('test Button3').setPixelSize(200,16).setStyleAttributes({'fontSize':'8pt','padding':'0px'});
var btn4 = app.createButton('test Button4').setPixelSize(200,60).setStyleAttributes({'fontSize':'8pt','paddingTop':'30px'});
app.add(btn1).add(btn2).add(btn3).add(btn4);
return app;
}
A combination od padding and verticalAlignment can give interesting results, see below :
var btn4 = app.createButton('testButton4').setPixelSize(200,60).setStyleAttributes({'fontSize':'8pt','paddingTop':'30px','vertical-align':'-11px'});
I have a several chart components that I have created in Flex. Basically I have set up a special UI that allows the user to select which of these charts they want to print. When they press the print button each of the selected charts is created dynamically then added to a container. Then I send this container off to FlexPrintJob.
i.e.
private function prePrint():void
{
var printSelection:Box = new Box();
printSelection.percentHeight = 100;
printSelection.percentWidth = 100;
printSelection.visible = true;
if (this.chkMyChart1.selected)
{
var rptMyChart1:Chart1Panel = new Chart1Panel();
rptMyChart1.percentHeight = 100;
rptMyChart1.percentWidth = 100;
rptMyChart1.visible = true;
printSelection.addChild(rptMyChart1);
}
print(printSelection);
}
private function print(container:Box):void
{
var job:FlexPrintJob;
job = new FlexPrintJob();
if (job.start()) {
job.addObject(container, FlexPrintJobScaleType.MATCH_WIDTH);
job.send();
}
}
This code works fine if the chart is actually displayed somewhere on the page but adding it dynamically as shown above does not. The print dialog will appear but nothing happens when I press OK.
So I really have two questions:
Is it possible to print flex components/charts when they are not visible on the screen?
If so, how do I do it / what am I doing wrong?
UPDATE:
Well, at least one thing wrong is my use of the percentages in the width and height. Using percentages doesn't really make sense when the Box is not contained in another object. Changing the height and width to fixed values actually allows the printing to progress and solves my initial problem.
printSelection.height = 100;
printSelection.width = 100;
But a new problem arises in that instead of seeing my chart, I see a black box instead. I have previously resolved this issue by setting the background colour of the chart to #FFFFFF but this doesn't seem to be working this time.
UPDATE 2:
I have seen some examples on the adobe site that add the container to the application but don't include it in the layout. This looks like the way to go.
i.e.
printSelection.includeInLayout = false;
addChild(printSelection);
Your component has to be on the stage in order to draw its contents, so you should try something like this:
printSelection.visible = false;
application.addChild(printSelection);
printSelection.width = ..;
printSelection.height = ...;
...
then do the printing
i'm not completely sure, but in one of my application I have to print out a complete Tab Navigator and the only method i have found to print it is to automatically scroll the tabnavigator tab in order to show the component on screen when i add them to the printjob.
In this way they are all printed. Before i created the tabnaviagotr scrolling the print (to PDF) result was a file with all the pages of the tab but only the one visible on screen really printed.
So I have two pictures of the weirdness that is occuring
As you can see in the picture above, the scroll bar on the right hand side is being cut off a little bit by the screen, and even when you scroll to the right, you don't get the bar back, it remains cut off.
Here is the other scenario:
Here, you can see that when I scroll down in this grid, the scroll bar kind of fits into the bottom of the grid and doesn't even go all the way down. You need to manually click into the grid and hit the down arrow to get the rest of the way down.
What could be causing both of these weird issues?
Edit:
Here is the code to generate the grid (Ext created through VB controls):
Dim VehicleOptionsGrid As New Akcelerant.Framework.WebControls.Grids.Grid
With VehicleOptionsGrid
.ID = "VehicleOptionsGrid"
.Title = "Vehicle Options"
.Toolbar.UseDefaultButtons = False
.Mode = Grids.Grid.GridMode.Control
.Panel.Border = False
.Panel.Style = "border-width:1px;margin-bottom:5px"
.Ref = "../../../../../VehicleOptionsGrid"
.Editable = True
With .Columns.Add("IsSelected", "Selection", Akcelerant.Framework.WebControls.Grids.Grid.ColumnDataType.Boolean)
.Renderer = "renderVehicleCheckbox"
End With
.Columns.Add("CollateralId", "").Hidden = True
.Columns.Add("OptionId", "OptionId").Hidden =True
.Columns.Add("OptionName", "Name").Width = 200
.GridHeight = 400
.DataBind()
ViewResponse.AddScript(.ToString(False))
ViewResponse.AddScript("VehicleOptionsGrid.grid.addListener('cellclick', changeOptionStatus);")
End With
Here is where we add the grid to the page:
With .AddPanel
With .AddPanel
.Title = ""
.Html = "Standard Options are preselected. Please select additional options as needed."
.Style = "padding-bottom:5px"
End With
.Ref = "../../../../VehicleOptionsPanel"
.Title = "Vehicle Options"
.Frame = True
.Style = "padding-bottom:5px"
.Layout = Pages.Panel.LayoutType.Column
.Height = 400
.Collapsed = True
.AddExtObject("VehicleOptionsGrid.grid")
End With
It seems that the grid sizes are higher than the actual component that holds the grid (a collapsible panel).