shahzaib
shahzaib

Reputation: 49

Crystal Report View Fit to Screen Size

Hello I am using Web forms to view a crystal report design on Sap Crystal report. But when I am accessing the report its not displaying full to screen size. Even though I have used style width and height to 100% in div and form tag. Please recommend the right solution. Attaching the code and Screenshot of report Display.

Report

Here is the Code.

  if (!IsPostBack)
        {
            // conn = Connections.database();
            CrystalDecisions.CrystalReports.Engine.ReportDocument report =
  new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            report.Load(Server.MapPath("ContractReport.rpt"));

           
            CrystalReportViewer2.ReportSource = report;
        }

here is aspx file

 <form id="form1" runat="server"  style="height:100%; width:100%;>
<div  style="height:100%; width:100%;  overflow:auto">
    <table   style="height:100%; width:100%">

            <tr>

                <td>
                    <CR:CrystalReportViewer ID="CrystalReportViewer2" 
          runat="server" AutoDataBind="true"  ToolPanelView="None"  
          BestFitPage="True" style="height:100%; width:100%;"   />

                </td>

            </tr>

        </table>

</div>
</form>

Upvotes: 1

Views: 2399

Answers (1)

Mahesh J
Mahesh J

Reputation: 1

For me this worked:

<CR:CrystalReportViewer ID="CrystalReportViewer2" runat="server" AutoDataBind="true" ToolPanelView="None" BestFitPage="False" Width="100%" Height="650px"/>

Adjust height in px as per your screen size. Additionally, I am using latest Crystal Report version.

Upvotes: 0

Related Questions