Wednesday, March 28, 2012
Help for printing reports programatically
I have developed a application which create the report and save it in
user selected location.
All this i done in one class. this application shows all the reports on
report server and render the report for user selected parameters. and
save it with folder browser option on a location. file name is report
name.
Now i have to write another class which will take this saved file name
as input and print that.
i found only printing method for a particular report but i dont want to
again render that report in print class. i have sen the available
articles on net which takes the report name and render it and print
that.
how i can access that saved file in another class and if i have to
again render that report then how i can pass those parameters value
again in render method in print class.
But for my application i have already render that report, so any one
please tell me how i can do that.
Thanks & Regards
DineshDinesh,
This is just a suggestion - what if you saved the report as a pdf file ?
Displaying a pdf file from a location on the hard disk doesn't need the
report engine anymore.
"Dinesh" <dinesht15@.gmail.com> wrote in message
news:1164717797.911571.169550@.j72g2000cwa.googlegroups.com...
> Hi.....
> I have developed a application which create the report and save it in
> user selected location.
> All this i done in one class. this application shows all the reports on
> report server and render the report for user selected parameters. and
> save it with folder browser option on a location. file name is report
> name.
>
> Now i have to write another class which will take this saved file name
> as input and print that.
> i found only printing method for a particular report but i dont want to
> again render that report in print class. i have sen the available
> articles on net which takes the report name and render it and print
> that.
>
> how i can access that saved file in another class and if i have to
> again render that report then how i can pass those parameters value
> again in render method in print class.
>
> But for my application i have already render that report, so any one
> please tell me how i can do that.
>
> Thanks & Regards
> Dinesh
>|||hi Andrei.......
Thanks for your reply.....
Ya you are right......It will not require report engine
again........
i want to know only that how i can print that saved file which is saved
in hard disk.
My problem is that i wrote print function in a seprate class. at that
place i am not able to access that file name with full path.......how
i can do this.......
if you know this please tell me..........
Thanks & Regards
Dinesh
Andrei wrote:
> Dinesh,
> This is just a suggestion - what if you saved the report as a pdf file ?
> Displaying a pdf file from a location on the hard disk doesn't need the
> report engine anymore.
> "Dinesh" <dinesht15@.gmail.com> wrote in message
> news:1164717797.911571.169550@.j72g2000cwa.googlegroups.com...
> > Hi.....
> >
> > I have developed a application which create the report and save it in
> > user selected location.
> >
> > All this i done in one class. this application shows all the reports on
> > report server and render the report for user selected parameters. and
> > save it with folder browser option on a location. file name is report
> > name.
> >
> >
> >
> > Now i have to write another class which will take this saved file name
> > as input and print that.
> >
> > i found only printing method for a particular report but i dont want to
> > again render that report in print class. i have sen the available
> > articles on net which takes the report name and render it and print
> > that.
> >
> >
> >
> > how i can access that saved file in another class and if i have to
> > again render that report then how i can pass those parameters value
> > again in render method in print class.
> >
> >
> >
> > But for my application i have already render that report, so any one
> > please tell me how i can do that.
> >
> >
> >
> > Thanks & Regards
> >
> > Dinesh
> >
Monday, March 26, 2012
Help for date in insert query
i want to save date using inert query like insert into tablname(field1,f2) values('jan',"& format(system.date.now,"dd/MM/yyyy hh:mm ") so to give error that char will not be converted to date and time.plz help its urgent.the same problem is with select query toooooo.
Hi,
You should elaborate more about the problem here. Post your code and let us know the way you are inserting data into the database and the fields types
Regards
|||i want to insert in a data base some thing using this query:
insert into tble1(field1,field2) values('this some thing or data','"& syatem.now &"');
which kind of date it will store like this 24/05/2007 11:16 AM or 24/05/2007 .i want to store 24/05/2007 11:16 AM this one.i using format function of vb.net like format(system.date,"dd/MM/yyyy hh:mm tt") but it give me error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value".in the select statement also this problem occure. i also use thhe select query as
select * from tbl1 where pdate='"& format(variabledate,"dd/MM/yyyy hh:mm tt") &"'" and it also give me error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value".this in acess work fine but in sql server give the above error.
|||
Hi,
please try something like following
Datetime dt = newDateTime(2007,6,18,13,56,30)); //year, month, day, hour, minute, seconds
thanks,
satish.
|||Hi there,
Use this command:
INSERT INTO TABLENAME (field1,field2) VALUES ('jan',getdate())
hope it helps you out,
gonzzas
|||
This is one of those difficult to answer questions because what you are trying to do is inheritly wrong. Datetime fields do not have a format. They represent a particular point in time. You can convert a datetime to and from a string with a specific format, but then it's no longer a datetime. You are trying to store a string with a format that sql server doesn't understand into a datetime field. SQL Server is attempting to covert your string into a real datetime so it can be stored, but the format isn't one it understands. Regardless of any of the correct formats you feed it, so long as it means the same point in time, ultimately it will get converted to the exact same number (Datetimes are internally represented by the number of days since the epoch, with the time portion being a fraction of a day).
|||Hi again,
Here is another example of a sql command that inserts a row in a table. One of the row fields has DATETIME datatype:
Dim strAsString ="insert into users (username,password,date) values ('username1','password1',convert(datetime,'18-06-2007 23:21:00',105))"
Dim commandAsNew SqlCommand(str, conn)Dim result = command.ExecuteScalar()
Where you see 105 it's the format chosen by me for this test. This format stores the data as dd-mm-yyyy hh:mm:ss
You can use another formats (do some light research on the subject, it should be enough) to meet your requirements: dd/mm/yyyy hh:mm:ss
gonzzas
|||
actually i solve the insert by using the query like
"insert into table tblname(f1,datef1) values('abc','"& system.datetime.now.tostring("MM/dd/yyyy hh:mm:ss") &"')"
but i still receiveing errors in select query that char conversion.
this stuff is doing in vb.net and sqlserver.