natloz
asked on
Crystal / VB.NET Default Zoom
When I load a Crystal Report into a Crystal Report Viewer....is there a way to set the DEFAULT ZOOM Factor to "WIDTH" of document?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
upps i putthe same article . sorry frodoman
ASKER
My report in my VB.NET Project is already set as article c2002925.asp states.
I have a form that is 800x600 that has a Report Viewer on it where I view all reports.
If I load a report the viewer Zoom default is at 100%.
In the toolbar of the viewer you can select "Page Width", but this doesn't seem to work...
I will try the CrViewer1.Zoom 75 to see if that will work (I am assuming this is at 75%).
I have a form that is 800x600 that has a Report Viewer on it where I view all reports.
If I load a report the viewer Zoom default is at 100%.
In the toolbar of the viewer you can select "Page Width", but this doesn't seem to work...
I will try the CrViewer1.Zoom 75 to see if that will work (I am assuming this is at 75%).
ASKER
'create and fill the Data Adapter
Dim oDa As New SqlDataAdapter(oComm) 'SQL Data Adapter object
oDa.Fill(oDs, "spGetAFEHeaderReport")
oComm.CommandText = "spGetAFEDetailReport"
oDa.Fill(oDs, "spGetAFEDetailReport")
rptAFE.SetDataSource(oDs)
frmReport.rptViewer.Zoom(7 5) <------ I ADDED THIS
frmReport.rptViewer.Select ionFormula = "{spGetAFEHeaderReport.var AFENumber} = '" & lblAFENumber.Text & "'"
frmReport.rptViewer.Report Source = rptAFE
frmReport.ShowDialog()
It still does not work...100% Zoom factor when the form loads
Dim oDa As New SqlDataAdapter(oComm) 'SQL Data Adapter object
oDa.Fill(oDs, "spGetAFEHeaderReport")
oComm.CommandText = "spGetAFEDetailReport"
oDa.Fill(oDs, "spGetAFEDetailReport")
rptAFE.SetDataSource(oDs)
frmReport.rptViewer.Zoom(7
frmReport.rptViewer.Select
frmReport.rptViewer.Report
frmReport.ShowDialog()
It still does not work...100% Zoom factor when the form loads
First, set your zoom AFTER you set the viewer reportsource - just drop your zoom line of code down below 'reportsource' line.
Unfortunatelty you may also be caught with a known bug with the .Net version: http://support.businessobjects.com/library/kbase/articles/c2013757.asp
I was involved in another discussion w/ someone who indicated he was going to try the approach in the link but was going to put in the form's activate or load or gotfocus events and see if it could be automatted w/out the button being needed. Sadly I never heard if this worked but you may want to give it a try.
HTH
frodoman
Unfortunatelty you may also be caught with a known bug with the .Net version: http://support.businessobjects.com/library/kbase/articles/c2013757.asp
I was involved in another discussion w/ someone who indicated he was going to try the approach in the link but was going to put in the form's activate or load or gotfocus events and see if it could be automatted w/out the button being needed. Sadly I never heard if this worked but you may want to give it a try.
HTH
frodoman
ASKER
I put the code into the ONLOAD event of the frmReport...Must be that you cannot pre-define the zoom factor until a report is acutally loaded in the viewer...Thanks for the help
ebolek gets the points for giving me the code snippet:
CRViewer1.Zoom 2
ebolek gets the points for giving me the code snippet:
CRViewer1.Zoom 2
Glad to help
ASKER
Sorry frodoman...I was writing my last post without seeing your last suggestion (which is what I tried already before seeing your last post...and I had already awarded points....if this makes sense.
No problem natloz - thanks for the explanation.
ASKER
I Tried you suggestion of setting it after REPORTSOURCE just for kicks and it did not work, it needs to go in the ONLOAD event of the form with the viewer after the frmReport.ShowDialog() command for it to work.
This may work though if you're using web viewer: http://support.businessobjects.com/library/kbase/articles/c2002925.asp