pascalmartin
asked on
Crystal report navigation
I have a Crystal report that displays the result of two linked dropdownlists. The dropdownlist and report sub are nested in the page.ini sub while I have nothing in the page.load sub.
When i click the navigation button to go to the next page my report disapear. Can you help me to fix that? Here is my code:
Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If Not IsPostBack Then
If Not Session("SUBCATID") Is Nothing Then
FillCat()
ConfigureCrystalReports()
ShowRept()
Else
FillCat()
ConfigureCrystalReports()
End If
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Private Sub ConfigureCrystalReports()
CrystalReportViewer.HasPag eNavigatio nButtons = True
'CrystalReportViewer.Toolb arImagesFo lderUrl = "~/Images"
CrystalReportViewer.HasExp ortButton = False
CrystalReportViewer.HasCry stalLogo = False
CrystalReportViewer.HasTog gleGroupTr eeButton = False
CrystalReportViewer.HasVie wList = False
CrystalReportViewer.HasPri ntButton = False
CrystalReportViewer.HasDri llUpButton = False
CrystalReportViewer.HasSea rchButton = False
CrystalReportViewer.HasGot oPageButto n = False
CrystalReportViewer.HasZoo mFactorLis t = False
CrystalReportViewer.Displa yToolbar = True
CrystalReportViewer.Border Width = 2
CrystalReportViewer.Border Color = Drawing.Color.DarkGreen
CrystalReportViewer.Displa yGroupTree = False
CrystalReportViewer.Displa yPage = True
CrystalReportViewer.BestFi tPage = True
End Sub
Sub ShowRept()
Dim cryRpt As New CrystalDecisions.CrystalRe ports.Engi ne.ReportD ocument
Dim CrTable As CrystalDecisions.CrystalRe ports.Engi ne.Table
Dim crtableLogoninfos As CrystalDecisions.Shared.Ta bleLogOnIn fo
cryRpt.Load(Server.MapPath ("~/Crysta lReports/C atalogue1. rpt"), CrystalDecisions.Shared.Op enReportMe thod.OpenR eportByTem pCopy)
For Each CrTable In cryRpt.Database.Tables
crtableLogoninfos = CrTable.LogOnInfo
With crtableLogoninfos.Connecti onInfo
.ServerName = "MYSERVER"
.DatabaseName = "MYDB"
.UserID = "sa"
.Password = "12345"
End With
CrTable.ApplyLogOnInfo(crt ableLogoni nfos)
Next CrTable
Dim crParameterFieldDefinition s As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
crParameterDiscreteValue.V alue = ddlSubCat.SelectedValue.To String
crParameterFieldDefinition s = cryRpt.DataDefinition.Para meterField s
crParameterFieldDefinition = crParameterFieldDefinition s.Item("@S UBCATID")
crParameterValues = crParameterFieldDefinition .CurrentVa lues
crParameterValues.Clear()
crParameterValues.Add(crPa rameterDis creteValue )
crParameterFieldDefinition .ApplyCurr entValues( crParamete rValues)
CrystalReportViewer.Report Source = cryRpt
btnPrnt.Visible = True
btnPDF.Visible = True
End Sub
When i click the navigation button to go to the next page my report disapear. Can you help me to fix that? Here is my code:
Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
If Not IsPostBack Then
If Not Session("SUBCATID") Is Nothing Then
FillCat()
ConfigureCrystalReports()
ShowRept()
Else
FillCat()
ConfigureCrystalReports()
End If
End If
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Private Sub ConfigureCrystalReports()
CrystalReportViewer.HasPag
'CrystalReportViewer.Toolb
CrystalReportViewer.HasExp
CrystalReportViewer.HasCry
CrystalReportViewer.HasTog
CrystalReportViewer.HasVie
CrystalReportViewer.HasPri
CrystalReportViewer.HasDri
CrystalReportViewer.HasSea
CrystalReportViewer.HasGot
CrystalReportViewer.HasZoo
CrystalReportViewer.Displa
CrystalReportViewer.Border
CrystalReportViewer.Border
CrystalReportViewer.Displa
CrystalReportViewer.Displa
CrystalReportViewer.BestFi
End Sub
Sub ShowRept()
Dim cryRpt As New CrystalDecisions.CrystalRe
Dim CrTable As CrystalDecisions.CrystalRe
Dim crtableLogoninfos As CrystalDecisions.Shared.Ta
cryRpt.Load(Server.MapPath
For Each CrTable In cryRpt.Database.Tables
crtableLogoninfos = CrTable.LogOnInfo
With crtableLogoninfos.Connecti
.ServerName = "MYSERVER"
.DatabaseName = "MYDB"
.UserID = "sa"
.Password = "12345"
End With
CrTable.ApplyLogOnInfo(crt
Next CrTable
Dim crParameterFieldDefinition
Dim crParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue
crParameterDiscreteValue.V
crParameterFieldDefinition
crParameterFieldDefinition
crParameterValues = crParameterFieldDefinition
crParameterValues.Clear()
crParameterValues.Add(crPa
crParameterFieldDefinition
CrystalReportViewer.Report
btnPrnt.Visible = True
btnPDF.Visible = True
End Sub
ASKER
Hi,
Please give me few day for implementing your solution, I have been extremely busy and not sitting at my desk for a while.
Best regards,
Please give me few day for implementing your solution, I have been extremely busy and not sitting at my desk for a while.
Best regards,
ASKER
Hi Ido,
I have been able to place the report into a session, but when I click on the navigation button the report disappear and only reappear with the next page after a postback.
I have been able to place the report into a session, but when I click on the navigation button the report disappear and only reappear with the next page after a postback.
Yes, navigation does do a postback which has to be handled in the code. I am not a .Net programmer so I don't know how to handle it.
mlmcc
mlmcc
ASKER
Can you clean up this question as no valid resolution was provided
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for pascalmartin's comment #a41422545
for the following reason:
Self resolution of the problem
Accepted answer: 0 points for pascalmartin's comment #a41422545
for the following reason:
Self resolution of the problem
How did you resolve the issue?
mlmcc
mlmcc
You were given one possible solution which you never really addressed as to if it works or not. There was also a comment that agreed you do get a postback and you have to handle it to get to the next page of the report.
WHat is your solution to the issue?
If there is no solution in the comments (yours or the experts) this question is useless and should be deleted.
mlmcc
WHat is your solution to the issue?
If there is no solution in the comments (yours or the experts) this question is useless and should be deleted.
mlmcc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is now a solution in the question.
It also appears you took my advice and handled the postback to solve the issue.
mlmcc
It also appears you took my advice and handled the postback to solve the issue.
mlmcc
ASKER
I solved the issue on my own no other solution offered could resolve the problem.
See: http://search.sap.com/ui/notes?id=0001985571&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64653D3939382669765F7361706E6F7465735F6E756D6265723D30303031393835353731&ssocompatible