Print in web

Stimulsoft Reports.NET discussion
Leandro
Posts: 74
Joined: Tue Aug 08, 2006 9:07 am
Location: Brasil

Print in web

Post by Leandro »

I made some impression test in the version web, but I am with doubt.
It follows below some configurations

Print Mode = Direct
The toolbox is printed with the content of the report.
If View Mode be configured One Page, it only page being visualized is printed.

Print Mode = Popup Window
In this configuration a popup is opened, with all the pages of the report, but the impression this incorrect, the end of the first page this being printed in begin it of second page and so forth.

Print Mode = Pdf
In this configuration this correct, the toolbox is not generated in Pdf and same being with View Mode = One Page all the pages are generated in the file Pdf

Does some way exist of using (Print Mode = Direct) and (View Mode = One Page) and what the result the direct impression is the same in Pdf?
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Print in web

Post by Vital »

We have added new property to StiWebViewer - PrintMode. This property solve your problems. Property will be available in build from 26 May.

Print Mode = Popup Window
In this configuration a popup is opened, with all the pages of the report, but the impression this incorrect, the end of the first page this being printed in begin it of second page and so forth.


Sorry, but we can't make DirectPrint and Popup mode equal to Pdf mode, because we can't control how web browser place html elements on printed pages.

Thank you.
Leandro
Posts: 74
Joined: Tue Aug 08, 2006 9:07 am
Location: Brasil

Print in web

Post by Leandro »

I didn't understand the use of the property PrintMode.

I made the following test, I configured PrintDestination = Direct and PrintMode = WholeReport
But even so it is only printed it page current that this being visualized in the report.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Print in web

Post by Vital »

Sorry, we can't reproduce this error. Please show code you are use to generate report.

Thank you.
Leandro
Posts: 74
Joined: Tue Aug 08, 2006 9:07 am
Location: Brasil

Print in web

Post by Leandro »

Asp.net

Code: Select all









    Untitled Page


    
    
        
       
    
    
    


C#

Code: Select all

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Components;
using System.IO;
using System.Drawing;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {   

        protected void Page_Load(object sender, EventArgs e)
        {
            string path = (string)Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Stimulsoft\\StimulReport.Net").GetValue("Bin") + "\\Data\\";
            DataSet dataSet1 = new DataSet(); ;
            if (File.Exists(path + "Demo.xsd")) dataSet1.ReadXmlSchema(path + "Demo.xsd");
            //else MessageBox.Show("File \"Demo.xsd\" not found");

            if (File.Exists(path + "Demo.xsd")) dataSet1.ReadXml(path + "Demo.xml");
            //else MessageBox.Show("File \"Demo.xml\" not found");           


            StiReport report = new StiReport();

            //Add data to datastore
            report.RegData(dataSet1);

            //Fill dictionary
            report.Dictionary.Synchronize();

            StiPage page = report.Pages[0];

            //Create HeaderBand
            StiHeaderBand headerBand = new StiHeaderBand();
            headerBand.Height = 0.5;
            headerBand.Name = "HeaderBand";
            page.Components.Add(headerBand);

            //Create text on header
            StiText headerText = new StiText(new RectangleD(0, 0, 5, 0.5));
            headerText.Text = "CompanyName";
            headerText.HorAlignment = StiTextHorAlignment.Center;
            headerText.Name = "HeaderText";
            headerText.Brush = new StiSolidBrush(Color.LightGreen);
            headerBand.Components.Add(headerText);

            //Create Databand
            StiDataBand dataBand = new StiDataBand();
            dataBand.DataSourceName = "Customers";
            dataBand.Height = 0.5;
            dataBand.Name = "DataBand";
            page.Components.Add(dataBand);

            //Create text
            StiText dataText = new StiText(new RectangleD(0, 0, 5, 0.5));
            dataText.Text = "{Line}.{Customers.CompanyName}";
            dataText.Name = "DataText";
            dataBand.Components.Add(dataText);

            //Create FooterBand
            StiFooterBand footerBand = new StiFooterBand();
            footerBand.Height = 0.5;
            footerBand.Name = "FooterBand";
            page.Components.Add(footerBand);

            //Create text on footer
            StiText footerText = new StiText(new RectangleD(0, 0, 5, 0.5));
            footerText.Text = "Count - {Count()}";
            footerText.HorAlignment = StiTextHorAlignment.Right;
            footerText.Name = "FooterText";
            footerText.Brush = new StiSolidBrush(Color.LightGreen);
            footerBand.Components.Add(footerText);            

            StiWebViewer1.Report = report;           

        }
    }
}
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Print in web

Post by Vital »

Thank you. We see problem. We will inform when we fix it.

Thank you.
Leandro
Posts: 74
Joined: Tue Aug 08, 2006 9:07 am
Location: Brasil

Print in web

Post by Leandro »

Using this configuration above also the toolbox this being impression


Making test used the following configuration in the of the it page

Code: Select all

    Untitled Page
    
imprimir.css

Code: Select all

.toolboxHidden
{
	display:none;
    visibility :hidden;
}
Analyzing the html generated by StimulReport.Net Web verified that the toolbox is inside of a , then I added the class "toolboxHidden" for this . It worked correctly, when I print the report the toolbox of the control it is occult.

It will be that possibility of the own control add this class in the of the toolbox
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Print in web

Post by Vital »

Please check build from 6 June.

Thank you.
Leandro
Posts: 74
Joined: Tue Aug 08, 2006 9:07 am
Location: Brasil

Print in web

Post by Leandro »

Thank you, gave certain. I tested the example http://www.devreports.com/webdemo.aspx in the firefox and in IE and gave certain, same visualizing only one page and PrintMode = Direct is printed all the 3 pages of the report without the toolbox.

But in my project didn't give certain, only in the firefox it is printed correctly, in IE it is printed only page being visualized with the toolbox.

Does some exist configuration that should be done? I altered the properties of the control this way
PrintDestination = Direct " PrintMode = WholeReport "

It follows the code source

Code: Select all









    Untitled Page    


    
    
               
    
    
    


Leandro
Posts: 74
Joined: Tue Aug 08, 2006 9:07 am
Location: Brasil

Print in web

Post by Leandro »

Analyzing the code that is generated by StimulReport when clicking in the button to print concludes the following:
The whole content of the report is generated inside of an iframe

Code: Select all

  

This it is occult and excuta the routine print () in the event onload,

Code: Select all

function CheckIsIE() {    
	if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') {    
		return true;    
	}    
	else{    
		return false;    
	}    
}    
function print() {    
	if (CheckIsIE() == true) {    
		document.buffer.focus();    
		document.buffer.print();    
	}    
	else {    
		window.frames['buffer'].focus();    
		window.frames['buffer'].print();    
	}    
}    

I didn't understand the because of the routine to be different when the browser is IE, making test executed the code below in IE 6 and IE 7 and the impression worked correctly
window.frames [' buffer'] .focus ();
window.frames [' buffer'] .print ();

But when it executes the code below it prints only the page that this being visualized and the toolbox
document.buffer.focus ();
document.buffer.print ();

What should do to execute the same code in all the browsers
Post Reply