on 04-22-2015 8:51 AM
First of all I must say, My English language skill is not good but I'll try to communicate as best as possible.
I am using Visual Studio 2013Ultimate with Update4 on .NetFramework 4.5.1 and Crystal Reports SP13.0.13.1597
When installed complete. ( Previously i have tried it with my project but CR & CRviewer not working)
I have tried using CRviewer in a new asp.net page The following code
***-----WebFrom1.aspx-----***
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButton ID="rdoByAll" runat="server" Text="all" GroupName="rdoChoose" AutoPostBack="True" />
FromDate :
<asp:TextBox ID="txtDateFrom1" runat="server" AutoPostBack="True"></asp:TextBox>
ToDate :
<asp:TextBox ID="txtDateTo1" runat="server" AutoPostBack="True"></asp:TextBox>
<asp:Button ID="btnCallReport1" runat="server" Text="CallReport" />
<br />
<br />
<asp:RadioButton ID="rdoByName" runat="server" Text="ByName" GroupName="rdoChoose" AutoPostBack="True" />
FromDate :
<asp:TextBox ID="txtDateFrom2" runat="server" Height="16px" Width="150px" AutoPostBack="True"></asp:TextBox>
ToDate :
<asp:TextBox ID="txtDateTo2" runat="server" Height="16px" Width="150px" AutoPostBack="True"></asp:TextBox>
<asp:Button ID="btnCallReport2" runat="server" Text="CallReport" />
<asp:DropDownList ID="ddlNamelist" runat="server" AutoPostBack="True">
</asp:DropDownList>
<br />
<br />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" ToolPanelView="None" />
<br />
</div>
</form>
</body>
***-----WebFrom1.aspx.vb-----***
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.Web
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub rdoByAll_CheckedChanged(sender As Object, e As EventArgs) Handles rdoByAll.CheckedChanged
If rdoByAll.Checked = True Then
txtDateFrom1.Enabled = True
txtDateTo1.Enabled = True
btnCallReport1.Enabled = True
txtDateFrom2.Enabled = False
txtDateTo2.Enabled = False
btnCallReport2.Enabled = False
ddlNamelist.Enabled = False
Else
txtDateFrom1.Enabled = False
txtDateTo1.Enabled = False
btnCallReport1.Enabled = False
txtDateFrom2.Enabled = True
txtDateTo2.Enabled = True
btnCallReport2.Enabled = True
ddlNamelist.Enabled = True
End If
End Sub
Protected Sub rdoByName_CheckedChanged(sender As Object, e As EventArgs) Handles rdoByName.CheckedChanged
rdoByAll_CheckedChanged(sender, e)
End Sub
Protected Sub btnCallReport1_Click(sender As Object, e As EventArgs) Handles btnCallReport1.Click
Dim rpt As New ReportDocument()
rpt.Load(Server.MapPath("CrystalReport1.rpt"))
Me.CrystalReportViewer1.ReportSource = rpt
Me.CrystalReportViewer1.RefreshReport()
End Sub
End Class
-------------------------------------------------------------------------------------------
When i press F5 to run project make Code of radiobutton not work(Disable,Enable OtherControl such as textbox)
And when i try press CallReportButton CRviewer do not show anything.
When I brought CRviewer leaving the page ,Code of Radiobutton were working fine.
But can't to show "CrystalReport1.rpt" on CRviewer when i click CallReportButton. i'm not understand.
Then i have tried to learn from follow this link :
i have to create a new CR ASP NET project and copy the whole C:\inetpub\wwwroot\aspnet_client folder
into my app folder and then add this to your web.config file, line in bold: <add key="vs:EnableBrowserLink" value="false"/>
project is working but not fine when I try to click button to call report I get this pop-up . " popup.JPG" what is it?
And project warning! could not find schema information every element . "Could not find every Element.JPG"
After that, copy the whole C:\inetpub\wwwroot\aspnet_client folder into my app folder Only! not add in my web.config
(In previous project need to use CR) make to project were working but i get same pop-up when i click to show report.
**** buleline in popup.JPG picture is "The report you requested requires further information"
I think you're over-complicating things. I'd like you to have a look at a few sample apps, see how they work, then adjust your app. Samples are here:
Crystal Reports for .NET SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
Also, have a look at Crystal Reports for Visual Studio 2005 Walkthro... | SCN (- applies to all versions of CR and .NET).
Finally, the Developer Help files are here:
SAP Crystal Reports .NET SDK Developer Guide
SAP Crystal Reports .NET API Guide
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow me on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Ludek
i'm beginner Programmer Now i have issue about the parameters Date Range
with two textbox and other control.
From the above code i have two textbox, one dropdownlist and button to call report.
I have tried using parameterfield and formurafield of CR But the results are not what I want.
(i use report wizard to connect database and choose field from view)
dropdownlist is a name and two textbox is date start and date end.
In order to filter the information displayed to report with dropdownlist and textbox
how should I do? help me please.
-Bas
To see the dev files, you have to download them local - Microsoft security requirement.
For date range. Since you want to be using your own text box, you will have to capture what the user entered, then pass that to the report engine in the correct format.
Else, if you create a date range parameter in the report designer, when you run the report, the report viewer will prompt for the data values and you do not need to worry about any code.
Remember the link I gave you for sample apps wiki? Have a look at csharp_win_rangeparameters.zip and csharp_win_sub_daterange_param_engine.zip and csharp_win_paramengine.zip.
This KBA may also be worthwhile to look at:
1214110 - How to pass a Date/Time parameter to a report at runtime using VB .NET
- Ludek
hi Ludek
I developed with VB web application I can use vb instead C # or not?
I want the user to select a range of dates on their own. To filter data displayed on CR.
I use 1 week for find a way for the user. Select a range of dates from the Textbox.
I hope that this will help me accomplish. I will try to learn, Thank for suggest Ludek.
if you create a date range parameter in the report designer, when you run the report, the report viewer will prompt for the data values and you do not need to worry about any code.
I tried it your way But still did not finished because of problems with the data type.
I'm going to ask new questions and provide details of the problem there.
Thank Ludek
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.