AllExperts > Experts 
Search      

C#

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More C# Answers
Question Library

Ask a question about C#
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Srini Nagarajan
Expertise
can answer any kind of questions in ASP.NET, C#, VB.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience
Contact me if you need any custom development on ASP.NET, ASP, Coldfusion, Powerbuilder
 
   

You are here:  Experts > Computing/Technology > C/C++ > C# > .net

Topic: C#



Expert: Srini Nagarajan
Date: 4/1/2008
Subject: .net

Question
QUESTION: in my report 3 tables condition is there.but dataset separate condition is there.how to print runtime condition,means dataset condition.this is my coding.

CrystalReport2 obj = new CrystalReport2();
           OdbcConnection con = new OdbcConnection(str);
           OdbcDataAdapter da = new OdbcDataAdapter("SELECT   distinct(Reserve_Group_Crm.Sno),Payment_Details1.Payee_Name,Reserve_Group_Crm.Group_Name,Room_Reserve.Room_Name,Room_Reserve.Room_No FROM   (staff.dbo.Reserve_Group_Crm Reserve_Group_Crm INNER JOIN staff.dbo.Room_Reserve Room_Reserve ON Reserve_Group_Crm.Sno=Room_Reserve.SerialNo) INNER JOIN staff.dbo.Payment_Details1 Payment_Details1 ON Room_Reserve.SerialNo=Payment_Details1.SerialNo where reserve_group_crm.sno=2", con);
           DataSet ds = new DataSet();
           da.Fill(ds, "emp");
           obj.SetDatabaseLogon("sa", "master");
           obj.SetDataSource(ds.Tables["emp"]);
           obj.PrintToPrinter(1, false, 0, 0);
if any modifictions.pls tell me.

i want print for particular record.not whole tables.how to do.


ANSWER: hi,

can you be more specific?  i don't understand what you are trying to do...

If you add proper join you should get only selected record.  May be show me exactly what is the result you are getting out of the tables.

-Srini

---------- FOLLOW-UP ----------

QUESTION: iam working in windows(c#).actually in my form one datagridview,and orint button is there.but datagridview 10 records is there.if i click second record.print only second record.not 10 record.how to do.

Answer
hi

you should get some unique id, pass the ID to SQL to filter and pass that to dataset.

to explain better, store the serial number or some unique id in the datagrid and make visible false if you don't want to show, when click print button loop thru the grid and see which one selected item, get the unique id and pass that to SQL, which will return only one record.

Happy programming!!

-Srini

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.