ok I did it : ReportDocument report = new ReportDocument(); report.Load(@"G:\Rp3Receipt.rpt",OpenReportMethod.OpenReportByTempCopy); ParameterFieldDefinitions parametersColl = report.DataDefinition.ParameterFields; ParameterFieldDefinition paramName1 = parametersColl["prmNameInReport1"]; ParameterFieldDefinition paramName2= parametersColl["prmNameInReport2"]; ParameterValues values = new ParameterValues(); ParameterDiscreteValue val = new ParameterDiscreteValue(); val.Value = paramValue1;// the value I want to give the parameter values.Add(val); paramName1.ApplyCurrentValues(values); //-----------second parameter values = new ParameterValues(); val = new ParameterDiscreteValue(); val.Value = paramValue2; values.Add(val); paramName2.ApplyCurrentValues(values); report.PrintOptions.PrinterName = @"\\...\HPLaserJ5"; report.PrintToPrinter(1,false,1,1);
sharon
Posts
-
Printing Crystal reports -
Printing Crystal reportsHello, I am trying to pring a crystal report with parameters without previewing it first. I succeeded to pring report without parameters with the ReportDocument object. I succeeded also to print report with parameters (I inserted parameters to ParameterFields and put it in crystalReportViewer.ParameterFieldInfo) from the CrystalReportViewer but in this way the report is open in another window, and then I print it from the object. But I want to print the report with the parameters without showing it on screen first, how can I do it? Thank u for any help, sharon
-
printing crystal reportThank you for this , but I still don't know how can I print this report with its parameters. ok, let say i made collection of parameters, how can i connect it to the report in order to print the report without preview? maybe with ReportDocument or some other object? Thank u anyway, sharon
-
printing crystal reportHello , I am trying to pring crystal report without openning a window with the crystal report itself. I succeeded to print crystal report without parameters by doing: ReportDocument report = new ReportDocument(); report.Load@"G:\Reports\Rp3Reciept.rpt"); report.PrintOptions.PrinterName = @"\\HPLaserJ5"; report.PrintOptions.PrinterDuplex = PrinterDuplex.Default; report.PrintToPrinter(1,false,1,1); and it is working good , but how can I send parameters to reportDocument. or How can I print report from CrystalReportViewer(becuase to it I can send parameters). (the printReport() method is virtual , that meens I have to write it?!) Thank you very much for any answer.:) sharon
-
DateTime.AddMinutesthank you very much, it was very helpfull, sharon
-
DateTime.AddMinutesdoes sombody knows why myDateTime.AddMinutes doesn't do anything? i am trying to do: DateTime myDateTime = Convert.ToDateTime("18/09/2002 13:00"); myDateTime.AddMinutes(40); but nothing happen to this myDateTime?? thanks in advance, sharon
-
Dynamic arraywith the object- ArrayList - you have to add : using Sustem.Collection;
-
new line in labelhow can I make new line in label? I want that a label will be with number unknwon of lines and i want it ot be handled in run time. i want that a string will be created in run time and than to do : label.text = string how can i do it??:confused: thank u. sharon
-
img button eventthank you very much , i'll try it later. sharon.
-
img button eventhello, I have a question: I have a written html page with image. when the user click on it i want it to raise event,I do not want to handle it throw the asp. I dont want to write:
I want to handle the onclick event in my aspx.cs file how can I do it? thank you very much for your help, sharon
-
paging dataGrid eventsthe line that debugger tells me is: complaintId = Convert.ToInt32(e.Item.Cells[6].Text); in chooseLine event i.e. he goes to the wrong event. why???
-
paging dataGrid eventsafter some debugging I noticed that when I change page it goes to the ChooseLine event and than go to the pageChang event (very weird):confused: maybe someone knowes why?
-
paging dataGrid eventshello you all, I have a problem: I have a dataGrid with two events: 1. public void DataGrid1_ChooseLine(object sender, DataGridCommandEventArgs e) { try{ complaintId = Convert.ToInt32(e.Item.Cells[6].Text); } catch(Exception e) { } } and: 2. public void changePage(Object sender, DataGridPageChangedEventArgs e) { DataGrid1.CurrentPageIndex = e.NewPageIndex; DataGrid1.DataSource = dataSet; DataGrid1.DataBind(); } each of them works wonderful alone, but when I use them both I get this exception: "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values..." what can be the problem and how can I change it to work? thank you very much for your help, sharon.
-
web forms sending parametersI have a webForm,Iwant that when the user click a button the page will change and I want to send this new page parameter (int id , string or anything else), how can I do it? I move to the next page by: Response.Redirect(...) thank you very much, sharon
-
Object unknownIs there a way I can use an object without knowing which object it realy is? for exemple: I have several objects that implement IEnumerable(these objects has arrayList), I need to Implement IEnumerator and I want to do it once. but I don't know for which object I implement it for so when I do : object.arrayList[i] -its an error. (object doen't have an arrayList property). how can I do it??? thanks in advance , sharon
-
take data from textBoxHello, I have a problem, i work with web pages, i want to fill labels in one webForm from the information of TextBox in another webForm , how can I do it? thanks, sharon.
-
create xml for collection classthank you for your help. sharon :)
-
create xml for collection classI succeeded to serialize an object, my problem is to serialize another object that contains an ArrayList of objects. I want to save in the xml each of the objects that are kept in the ArrayList, how can I do it??? thank you very much,sharon
-
open a window from a webPageI have a webPage , I want to click on a button that will open a window (with the search reasult from my database),how can I do it? thank u very much, sharon