|
|
Comments and Discussions
|
|
 |

|
Nice work,
I've been using for some years, CR on vs2005 changed at runtime to show or hide columns, change size and font of fields. But instead using parameters, I use formulas.
|
|
|
|

|
Thanks for this article.
In this article you have discussed about adding columns(paramField.Name = "col" + columnNo.ToString()) .
My question is i want to know how to add "rows" to the report.
In other words, i want to display the search results of 5 different employees(empid is different) from the same table into the same report page.
As i am new to sql and crystal report. I dont have any clues about it.
Thanks in advance.
|
|
|
|

|
Hi...I Did The Same Project But For Me "Enter parameter values" Dialog Box Is Showing And Asking For Parameter Values And After I Gave The Values...It Is Showing The Values That I Entered,But Not Showing The Data Retrieving From The Database...Please Help Me..Thanking You
|
|
|
|

|
Thanku
|
|
|
|

|
hi friend..actually i developing a web application,in that application i placed one gridview control and i displayed all the database values in that gridview...in that gridview i provide an option like print,if i click the print link for the particular record ,the selected record will be displayed in the crystal report.....can u explain me how to do this....
|
|
|
|
|

|
in this sample, width of the columns are fixed. this isn't good enough. It'd be better if column width could be dynamically adjusted according to the contents of the column.
|
|
|
|

|
which is not the point of the article.
"My opinion is not represented by my hometown."
|
|
|
|
|

|
Hi,
I have a question about crystal report in visual studio 2008. I use object crystal report viewer for show my report:
crystalReportViewer.ReportSource = reportDocument;
crystalReportViewer.ParameterFieldInfo = report.ParameterFields;
crystalReportViewer.Refresh();
When I change parameter of report on user interface , memory of program is increase about 3-5 MB. How can I clean old data before change parameter ? I don't know where is data of report. Thanks so much!
|
|
|
|

|
Good afternoon sir, I m Dinesh.. i m creating a project in ADO.NET with SQL server 2005 as a back end.. i have a question that after deploying my project for installation on OTHER machine..will my program give me error if destination machine server name does not match with my server name which i have used in my application..?? i used this code: Data Source=Dinesh; Initial Catalog=college_Management_System; User ID=sa; Password=*****;
plz reply me sir soon... Dinesh92
|
|
|
|

|
it is a good article but i want this same thing that take data from multiple tables,i dont know how to query for this case???
|
|
|
|
|

|
Nice article
|
|
|
|

|
Thx~~~ Save a lot of time
|
|
|
|

|
Thanks this is Really working code
|
|
|
|

|
wonderful demonstration on the subject...
Thank you
|
|
|
|

|
Really a heartful of thanks ..
very good tutorial...
|
|
|
|

|
Here you have created all columns in the Crystal report and according to the query it is showing up.But without specifying all columns (For more than 20 columns) how to code it?
|
|
|
|

|
i am making desktop application using C#.Net and Sql SERVER 2008.I want to make crystal reports after seen your this article i am able to create crystal report...how u wrote in article i did same but when i select the checkbox for report i am getting error "incorrect parameter".i have created a table called Media_Method with fields(Media_method_ID,Media_Name,Target_Audience).Parameter fields after adding crystal report is id,name,target respectively .I have tried follwing code
private string CreateSelectQueryAndParameters()
{
ReportDocument reportDocument;
ParameterFields paramFields;
ParameterField paramField;
ParameterDiscreteValue paramDiscreteValue;
reportDocument = new ReportDocument();
paramFields = new ParameterFields();
string query = "SELECT ";
int columnNo = 0;
if (chbid.Checked)
{
columnNo++;
query = query.Insert(query.Length, "Media_method_ID as Column" +
columnNo.ToString());
paramField = new ParameterField();
paramField.Name = "id" + columnNo.ToString();
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "Media method ID";
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
}
if (chbname.Checked)
{
columnNo++;
if (query.Contains("Column"))
{
query = query.Insert(query.Length, ", ");
}
query = query.Insert(query.Length, "Media_Name as Column" +
columnNo.ToString());
paramField = new ParameterField();
paramField.Name = "col" + columnNo.ToString();
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "Media Name"; paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
}
if (chbtarget.Checked)
{
columnNo++; //To determine Column number
if (query.Contains("Column"))
{
query = query.Insert(query.Length, ", ");
}
query = query.Insert(query.Length, "Target_Audience as Column" +
columnNo.ToString());
paramField = new ParameterField();
paramField.Name = "col" + columnNo.ToString();
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "Target Audience";
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
}
//if there is any remaining parameter, assign empty value for that
//parameter.
for (int i = columnNo; i < 5; i++)
{
columnNo++;
paramField = new ParameterField();
paramField.Name = "col" + columnNo.ToString();
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "";
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
}
crystalReportViewer1.ParameterFieldInfo = paramFields;
query += " FROM Media_Method";
return query;
}
please check bold content properly
private void button1_Click(object sender, EventArgs e)
{
CrystalReport1 objRpt = new CrystalReport1();
string connString = "Data Source=SW-PC-20;Initial Catalog=PSM;Integrated Security=True";
string query = CreateSelectQueryAndParameters();
if (!query.Contains("Column"))
{
MessageBox.Show("No selection to display!");
return;
}
try
{
SqlConnection Conn = new SqlConnection(connString);
SqlDataAdapter adepter =
new SqlDataAdapter(query, connString);
DataSet1 Ds = new DataSet1();
adepter.Fill(Ds, "Media_Method");
objRpt.SetDataSource(Ds);
crystalReportViewer1.ReportSource = objRpt;
}
catch (SqlException oleEx)
{
MessageBox.Show(oleEx.Message);
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
}
please help me if i am wrong
|
|
|
|

|
Its good, but it can do with improvement. Like referencing more than one table.
|
|
|
|

|
I posted this my problem in topic : http://www.codeproject.com/Questions/159722/Problem-with-crystal-report-layout-dynamic.aspx
Can you help me to resolve it
Thanks and Best regards,
|
|
|
|

|
Thank you! It helps a lot.
|
|
|
|

|
This has really helped me.
I still have the parameter prompt coming up even though the parameters are set.
If I disable the prompt I get this error "Unable to get SI_MACHINECHOICE property value".
I noticed that the OK button on the parameter prompt submits a postback, do you have some insight on why this is happening?
Thanks again
|
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This program shows how to dynamically load data from a database and application into the Crystal Report
| Type | Article |
| Licence | CPOL |
| First Posted | 28 Sep 2007 |
| Views | 270,354 |
| Downloads | 14,387 |
| Bookmarked | 138 times |
|
|