|
-Regarding above i got no problem and success to created a crystal report, it only row of data to display.
- now i using query to store data into variable and using while root to dipslay by using above feature , is it possible ? can give me some source ?
or other opinion for me , please very urgent
- e.g.
strSQL = "SELECT a.r_materials_num,a.r_batch_num, a.r_des,a.r_UOM,a.r_exp_date ,(select sum(r_QTY) FROM tblreport_1 where r_situation = '" + "In" + "' and r_materials_num = a.r_materials_num and r_batch_num = a.r_batch_num ) as totalIn , (select sum(r_QTY) FROM tblreport_1 where r_situation = '" + "Out" + "' and r_materials_num = a.r_materials_num and r_batch_num = a.r_batch_num ) as totalOut FROM tblreport_1 a where a.r_situation = '" + "In" + "' GROUP BY a.r_materials_num,a.r_batch_num,a.r_des,a.r_UOM,a.r_exp_date "
PublicFunc.DR = DataHandler.GetDataReader(PublicFunc.strSQL, PublicFunc.strConn)
While DR.Read()
viewstate("r_materials_num") = Trim(PublicFunc.DR("r_materials_num").ToString)
viewstate("r_batch_num") = Trim(PublicFunc.DR("r_batch_num").ToString)
viewstate("r_UOM") = Trim(PublicFunc.DR("r_uom").ToString)
viewstate("r_des") = Trim(PublicFunc.DR("r_des").ToString)
viewstate("r_exp_date") = Trim(PublicFunc.DR("r_exp_date").ToString)
viewstate("totalIn") = Trim(PublicFunc.DR("totalIn").ToString)
If PublicFunc.DR("totalOut").ToString = "" Then
viewstate("totalOut") = 0
Else
viewstate("totalOut") = Trim(PublicFunc.DR("totalOut").ToString)
End If
keepOUT = viewstate("totalOut")
keepIn = viewstate("totalIn")
KeepQTY = keepIn - keepOUT
If KeepQTY <> 0 Then
Response.Write(" ")
Response.Write("")
Response.Write(viewstate("r_materials_num"))
Response.Write(" ")
Response.Write("")
Response.Write(viewstate("r_des"))
Response.Write(" ")
Response.Write("")
Response.Write(viewstate("r_batch_num"))
Response.Write(" ")
Response.Write("")
Response.Write(KeepQTY)
Response.Write(" ")
Response.Write("")
Response.Write(viewstate("r_UOM"))
Response.Write(" ")
Response.Write("")
Response.Write(viewstate("r_exp_date"))
Response.Write(" ")
Response.Write("")
Else
End If
End While
- i want use those display result to display on crystal report it is possible ?
email beginhs@gmail.com
regds
begin
|
|
|
|
|
Hi
I went through your code but was unable to get this line of code in your code.
CrystalReport1 report=new CrystalReport1();
I performed a different steps in my project for the dataset which gets generated on runtime.
Now i take a blank report .rpt file as u specified in your explanation.
but when i trying to write the CrystalReport1 report=new CrystalReport1(); code
my intellisense doesnt shows me the reference of CrystalReport1
My .rpt file name is CrystalReport1.rpt.
can u give me explanation for the above scenario.
Waiting for reply
Thanks in advance
-- modified at 2:35 Tuesday 18th July, 2006
|
|
|
|
|
How can i pass datas from textboxes to crystal report
|
|
|
|
|
I did exactly the same thing which you mentioned in the above article in VB.NET.
All the initializations which you did in the PageLoad() function were done in the Initialization() function of the Form.
But now when I bind the Dataset into a DataGrid, it shows the data but when I bind it with the Crystal Report a logon window pops up asking me the data source and server name with login and password for the source of this report (even when I have clearly mentioned the source and login information using the SetDataSource and SetDatabaseLogin functions)
Any Ideas why?
crap learner !
|
|
|
|
|
Dear sir
i want to use keyup in datagrid
how to do that
Plz.. urgently req..
thanks..
|
|
|
|
|
Dear sir,
I want to use crystal report in asp.net..
with Chart..
Urgently req..
Thanks..
|
|
|
|
|
Hi All,
I'm trying to call a Crystal report 11 (Sample.rpt) generated from Stored procedure from my aspx page (Sample.aspx). When I scroll to next page using the next button in the Crystal report viewer, it is taking more time. Then I found that it is executing the stored procedure and displaying the next page. Why is it. But if we run the report preview from Crystal reports there is no such an issue for scrolling. Please help.
My aspx code is given below. I'm missing something. Your help is greatly appreciated.
<%@ Page language="VB" %>
<%@ Register TagPrefix="cr" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web" %>
Sub Page_Load(s as Object,e As EventArgs)
If not isPostBack then
Dim sRptName as string
sRptName="Sample.rpt"
CrystalReportViewer1.ReportSource=Server.MapPath(sRptName)
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.HasRefreshButton = True
End If
End Sub
<cr:crystalreportviewer id="CrystalReportViewer1" style="Z-INDEX: 102; LEFT: 222px; POSITION: absolute; TOP: 80px"
="" runat="server" autodatabind="true" width="445px" height="947px">
|
|
|
|
|
How i can use 'push method' without 'add DataSet from solution explorer'?
In case when DataSet already created and initialized from code.
Thanks in advance.
|
|
|
|
|
I had a hairy SQL statement which I would never be able to build with CR, the last resort was to code the report by hand until I sussed the SetDataSource method, the glue missing was the XML schema which I needed to create, once that was done, it worked like a charm. Thanks for the aricle.
My Blog ^
|
|
|
|
|
CrystalReport1 report=new CrystalReport1();
CrystalReportViewer1.Visible=true;
report.SetDataSource(Ds.Tables[0]);
CrystalReportViewer1.ReportSource = report;
I have above code to fill report, when i run first time it did not fill the report. I went to solution and create a CR report. Connect the database from server explorer and get the table and drag the col that i want on the report. and worked fine.
If i do this whats do use of the DS. How DS releated to the report. Is this the way doing this. My DS already have the data. How come its not showing with out plugging the data from server solution.
Am i doing this wrong. seems like there is two connection and tow data.
DS and report
is this the way to do push?
|
|
|
|
|
How to connect crystal report file in ASP.Net using C# language during runtime to generate the report
|
|
|
|
|
This would seem to be straightforward but is not (for me at least!) I'm creating a report in a separate *aspx page, and the display is always centered (or more toward the far right of the page. I want to have the display left justified .... have tried on the page holding the crystal report viewer, putting review control in table, going through the .Net crystal report form, all to no avail.
|
|
|
|
|
Will you be using the Group Tree option? Your report appears to be centered because the group tree is blank.
If you will not be needing this,
just set your Viewer's(CrystalReportViewer) DisplayGroupTree to false.
G'luck!
kRoN
|
|
|
|
|
hi any example of using a crystal report in asp.net, using the northwind table of sql... thnx...
|
|
|
|
|
Visual Studio 2003 / SQL 2005 Beta
For some reason I can not use the GUI to create dataset from my stored procedure. It may be because I have multiple selects or it may be SQL 2005. In any case, I must code my dataset by hand. Once done I would think that it would be easy to point my crystal report at this dataset. It not though. I am getting a Logon failed error. If I omit all code and just run the function that creates the dataset I get no error. When should I have a security issue binding the report to a dataset that is in .NET already? Does anyone see anyting wrong with this code?
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace ptr
{
///
/// Summary description for availToActualHoursDS.
///
public class availToActualHoursDS : System.Web.UI.Page
{
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
availToActualHoursCR MyReport = new availToActualHoursCR();
CrystalReportViewer1.Visible=true;
// get Logon failed error with and without this code.
CrystalDecisions.Shared.TableLogOnInfo MyLogonInfo;
CrystalReportViewer1.LogOnInfo = new CrystalDecisions.Shared.TableLogOnInfos();
MyLogonInfo = new CrystalDecisions.Shared.TableLogOnInfo();
MyLogonInfo.TableName="MyReport";
MyLogonInfo.ConnectionInfo.UserID = "reporting";
MyLogonInfo.ConnectionInfo.Password = "password";
MyLogonInfo.ConnectionInfo.DatabaseName = "nyce";
CrystalReportViewer1.LogOnInfo.Add(MyLogonInfo);
// set report's dataset
MyReport.SetDataSource(CreateATAHDataSet(2003, 8, 2004, 7, "55200,55300"));
// set report source
CrystalReportViewer1.ReportSource = MyReport;
}
// create a dataset for the cyrstal report to report off of
private DataSet CreateATAHDataSet(int startyearpart, int startmonthpart, int endyearpart, int endmonthpart, string ccntrs)
{
//11-16 Prog ASP.NET - Stored Procedures
string connectionString = "server=cfaulkner; uid=reporting; pwd=password; database=NYCE";
System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(connectionString);
connection.Open();
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand();
command.Connection = connection;
command.CommandText = "sp_rpt_EmpHrsAvailToActualHrsByMonth";
command.CommandType = CommandType.StoredProcedure;
System.Data.SqlClient.SqlParameter param;
param = command.Parameters.Add("@startyearpart", SqlDbType.Int);
param.Direction = ParameterDirection.Input;
param.Value = startyearpart;
param = command.Parameters.Add("@startmonthpart", SqlDbType.Int);
param.Direction = ParameterDirection.Input;
param.Value = startmonthpart;
param = command.Parameters.Add("@endyearpart", SqlDbType.Int);
param.Direction = ParameterDirection.Input;
param.Value = endyearpart;
param = command.Parameters.Add("@endmonthpart", SqlDbType.Int);
param.Direction = ParameterDirection.Input;
param.Value = endmonthpart;
param = command.Parameters.Add("@ccntrs", SqlDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = ccntrs;
SqlDataAdapter dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand = command;
dataAdapter.TableMappings.Add("Table", "ATAH");
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet);
return dataSet;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Thanks for ANY help! I have been racking my brain for days on this.
Craig
|
|
|
|
|
Keep racking your brain. That error message could be just about anything. I've had it too, dunno what solved it but I'm carefull not to touch the reports to much or I'm afraid i get it again.
I have just spend 15 hours infront of Crystal Reports. I have spent 2 month solving different problems working more the full time, weekends. When I pass one another one shows up and I'm back where I started. I have read books, installed updates (those are a joke btw.), if I get something to work there is allways ten other things that isn't.
Today I'm giving up. I am so f***ing tired of this. I finally decided to go with the most simples and basic solution of all. I decided to create one single table for each of the reports that I'm doing. One of the tables has around 800-900 columns. This is a solution that works. So I started to put all the fields out on the reports and then I realised that the designer can't keep the positions and sizes of the elements.
I have lost sooo many hours on this, it's not even funny anymore. I'm a developer, I have written code since I was 13 and I have gone through much problem solving. But working with Crystal Repors cost me all my love for developing.
I'm giving up.. bye bye coding and computers
----------------
Frasse
|
|
|
|
|
If the report having a sub report, how can I do? How to push the dataset into the sub-report. Thanks.
|
|
|
|
|
This is a great article for anyone who wants to learn how to create reports with Crystal Reports, as I did with this simple and great article.
Since then however, I have developed a deep hate towards Crystal Reports.
Even thou I have never made such statement in public before, I can just say how glad I am to get this off my chest. Because the only thing this product have given me the last month or so is sorrow and nervous breakdowns. If I was living in the US, I would sue the muther f***er who is responsible for this software.
My advice to any of you who even consider doing any report that requires more then five bindings to a single datatable, for your own sanity sake do not use Crystal Reports. For small applications like the one used in this tutorial you may even like it.
I stand by my statement, feel free to flame me but I doubt anyone will because I beleive that there are alot of peoples out there that need counceling after they have used this frustrating tool.
--------------------------------------------------------------
This is where you send your flames: Fredrik Andersson
|
|
|
|
|
Hello ,
I make SeparatePages property of crystal viewer false. So that all crystal report pages appear in one asp.net page. But what happens is, my page design shows only for one page hight and the content goes beyond page design. So basically content does not fit into the asp.net page at run time.
What can be the solution of this problem.
Please let me know if you want more information.
Best Regards
|
|
|
|
|
Hi,
Can anyone provide the solution for following error.
CrystalDecisions.CrystalReports.Engine.DataSourceException: Query Engine Error:
Some of the reports are displayed properly. For some it's giving this error.
Order and type of parameters passed are just perfect and so is the location of report.
I dont know where's the problem..
Plz reply asap.
Thanks in anticipation
|
|
|
|
|
Using pull method i can display the image in the crystal report. this can be done by using the subreport.
But when we are using the push method, how is it possible to use sub report ...?
or is there any other method by which i can display the image on the report.
Regards,
Sandeep Patel
|
|
|
|
|
When i am using one datasource, the reports are working fine ... but i want to use 2 datatables.... is it possible..
sqlConn = New SqlConnection(ConnString)
Dim strSql As String
sqlcommd = New SqlCommand
' sqlcommd.Parameters.Add("@quantity", TextBox2.Text)
sqlcommd.Parameters.Add("@EmployeeID", TextBox1.Text)
sqlcommd.CommandText = "USP_Report"
sqlcommd.CommandType = CommandType.StoredProcedure
sqlcommd.Connection = sqlConn
daObj = New SqlDataAdapter
daObj.SelectCommand = sqlcommd
dsObj = New DataSet
daObj.Fill(dsObj, "Emp")
crpt.Visible = True
cr.Load(Server.MapPath("crpt.rpt"))
cr.SetDataSource(dsObj.Tables("Emp"))
cr.SetDataSource(dsObj.Tables("orders"))----- can this be added
crpt.ReportSource = cr
Regards,
Sandeep Patel
|
|
|
|
|
I was bulid a project buy following this mothed. however, I get a error..
please help me out.
----------------------------------------------------
Error in File C:\DOCUME~1\TEPC402\ASPNET\LOCALS~1\Temp\temp_198f502c-275c-44a1-88a4-89a648a75696.rpt: Unable to connect: incorrect log on parameters.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Error in File C:\DOCUME~1\TEPC402\ASPNET\LOCALS~1\Temp\temp_198f502c-275c-44a1-88a4-89a648a75696.rpt: Unable to connect: incorrect log on parameters.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[LogOnException: Error in File C:\DOCUME~1\TEPC402\ASPNET\LOCALS~1\Temp\temp_198f502c-275c-44a1-88a4-89a648a75696.rpt:
Unable to connect: incorrect log on parameters.]
.L(String , EngineExceptionErrorID )
.G(Int16
, Int32 )
.F(Int16 )
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext)
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext)
CrystalDecisions.Web.ReportAgent.{(Boolean C)
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Page.ProcessRequestMain()
nan
|
|
|
|
|
This is another Crystal Reports Bug... install last service pack... from this location
http://support.businessobjects.com/fix/downloads_updates.asp
|
|
|
|
|
How can I read ahead in the database... I need to get integer values from the database several rows below the current row that crystal reports is on
|
|
|
|