Crystal Reports asking for logon

Daru

New member
Joined
May 10, 2012
Messages
2
Programming Experience
1-3
I'm trying to get started with Crystal Reports using a reduced code approach. I tried inserting a SqlDataSource, CrystalReportViewer and CrystalReportSource as you can see below, with nothing inserted in the codebehind.
I do other consults to the same database with the connectionstring used here and defined at web.config so that's not the problem (i think). Shouldn't i be able to at least get past the login screen with that, and if not, what am i doing wrong at the moment?
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"
SelectCommand="SELECT * FROM [Report] WHERE ([CodeU] = ?)">
<SelectParameters>
<asp:QueryStringParameter Name="CodeU" QueryStringField="codeQS"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
<Report FileName="Print.rpt">
<DataSources>
<%--TableName="Report" --%>
<CR:DataSourceRef DataSourceID="SqlDataSource1" />
</DataSources>
</Report>
</CR:CrystalReportSource>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server"
AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="1202px"
ReportSourceID="CrystalReportSource1" ToolbarImagesFolderUrl=""
ToolPanelWidth="200px" Width="1104px" />
</div>
</form>
 
You should be able to manually code the login credentials.Ex:

Public Class Form16

Private Sub Form16_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim view As New CrystalReport4
Dim user as string = "Username"
Dim pwd as string = "Password"

view.SetDatabaseLogon(user, pwd)
view.SetParameterValue("p_1", Form5.no_faktur_tb_immanuel)
CrystalReportViewer1.ReportSource = view
End Sub
End Class

 
Back
Top