Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: PaperSize A6 Post Reply Post New Topic
Author Message
rominita
Newbie
Newbie


Joined: 29 Aug 2007
Location: Italy
Online Status: Offline
Posts: 2
Quote rominita Replybullet Topic: PaperSize A6
    Posted: 29 Aug 2007 at 2:57am
Hello, I want to print a report in A6 format but this format is not defined from the PaperSize class. Someone can help me? In version XI is implemented this functionality?
Sorry for my English!
Thank you!!!
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 29 Aug 2007 at 1:01pm
CR XI determines the paper sizes available based on the printer. If you need A6 you will need to use a printer that supports that size.  You can change the printer by clicking on the Printer button in the File->Page Setup menu. Once that is done you should see A6 as a paper size choice.
 
Hope this helps
 
Regards,
 
John W.
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 29 Aug 2007 at 1:02pm

I just reread your post, were looking to do this in code vs. the Report Designer?

 
John W.
IP IP Logged
rominita
Newbie
Newbie


Joined: 29 Aug 2007
Location: Italy
Online Status: Offline
Posts: 2
Quote rominita Replybullet Posted: 30 Aug 2007 at 5:52am
Hi! Thanks a lot for your answer. My problem is setting paper size from code. 
In a Report Disegner in a Printer Setup menu I had put A6 format, and the report is corretted, but when export Report in a pdf, if itsn't specificated papersize, the size is 11 x 8,50 inch (that it correspond at define PaperSize.PaperLetter Confused). I'm making a web application and using c#. 
For example:
ReportDocument crReportDocument;
ExportOptions crExportOptions;
DiskFileDestinationOptions crDiskFileDestinationOptions;
crReportDocument = new ReportDocument();
// A5
crReportDocument.Load(Request.PhysicalApplicationPath + "\\Report\\CrystalReport_A5.rpt");
crReportDocument.PrintOptions.PaperSize = PaperSize.PaperA5;
crReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
        
crReportDocument.RecordSelectionFormula = "({StampaEtichetta.id} = 1)";
        
// Sets the logon info matching tables to admin as the user name and pass as the password
SetDatabaseLogonReport(crReportDocument, this);
//Export to PDF
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
        
//append a filename to the export path and set this file as the filename property for
//the DestinationOptions class
crDiskFileDestinationOptions.DiskFileName = Request.PhysicalApplicationPath + Session.SessionID.ToString() + ".pdf";
crExportOptions = crReportDocument.ExportOptions;
//set the required report ExportOptions properties
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
       
//Once the export options have been set for the report, the report can be exported. The Export command
//does not take any arguments
try
{
            // Export the report
            crReportDocument.Export();
            crReportDocument.Close();
            Response.Clear();
            Response.ClearContent();
            Response.ClearHeaders();
            Response.ContentType = "application/pdf";
            Response.AddHeader("Content-disposition", "attachment;  filename=\"Etichetta.pdf\"");
           
            Response.WriteFile(crDiskFileDestinationOptions.DiskFileName);
            Response.Flush();
            Response.Close();
            System.IO.File.Delete(crDiskFileDestinationOptions.DiskFileName);
}
catch (Exception err)
{
            Response.Write("<BR>");
            Response.Write(err.Message.ToString());
}


Edited by rominita - 30 Aug 2007 at 8:31am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.