|
Hello Every Body,
I have a button on my page, when i click btnShowReports then it shows my desire reports without asking login information (on page load event i put the report viewer login information)
But problem is, when i click the CrystalReportViewer toolbar (Export, Print) then nothing come also it invisible my CrystalReportViewer.
If I do it on Page_Load event then CrystalReportViewer toolbar work nicely
My Code is Below:
ASPX CODE
<br />
<tr><br />
<td colspan="3" style="font-size: x-large; color: #000066"><br />
<asp:Button ID="btnShowReports" runat="server" Text="Show Reports" Visible="False" /></td><br />
</tr><br />
<tr><br />
<td colspan="3" style="font-size: x-large; color: #000066"><br />
</td><br />
</tr><br />
<tr><br />
<td colspan="3" style="vertical-align: top; text-align: center"><br />
<CR:CrystalReportViewer ID="crViewer" runat="server" AutoDataBind="true" ShowAllPageIds="True" BorderColor="#E0E0E0" BorderStyle="Solid" Height="50px" /><br />
<br />
</td><br />
</tr><br />
ASPX.VB CODE btn click event
<br />
Dim _Connection As SqlConnection = New SqlConnection(Web.Configuration.WebConfigurationManager.ConnectionStrings("TCCLMS").ConnectionString)<br />
Dim _QueryString As String = "SELECT MEMBERID, BOOKID, DATETAKEN, DUEDATE, SUBMITDATE FROM BORROWERS"<br />
Dim _DataAdapter As SqlDataAdapter = New SqlDataAdapter(_QueryString, _Connection)<br />
Dim _dtBorrowersDataTable As dsReportViewer.dtBorrowersDataTable = New dsReportViewer.dtBorrowersDataTable()<br />
Dim _ReportBorrowers As ReportDocument = New ReportDocument()<br />
Try<br />
_Connection.Open()<br />
_DataAdapter.Fill(_dtBorrowersDataTable)<br />
_ReportBorrowers.Load(Server.MapPath("crBorrowers.rpt"))<br />
_ReportBorrowers.SetDataSource(CType(_dtBorrowersDataTable, DataTable))<br />
Me.crViewer.ReportSource = _ReportBorrowers<br />
Me.crViewer.DataBind()<br />
<br />
Catch ex As Exception<br />
<br />
End Try<br />
any instruction will be really helpful
thanks in advance
Sarfarj Ahmed
|
|
|
|
|
Hi Everyone,
Is it possible to schedule a task daily using asp.net and vb without using windows scheduled task and services. I tried using threads, it is consuming more memory and system gets hanged.
Can any one help me in this regard.
Regards,
Manowj
|
|
|
|
|
You could use a SQL job if this is an option. What is wrong with a service (it's what they're designed for)?
|
|
|
|
|
What you could do is to check the local server time when the web page is called, and if it is within a certain range then run a special routine / function call to do the task. You could then set a flag in your application so that if another user calls the page within that time range, the task doesn't execute again.
As long as you are certain that you will have at least 1 visitor between those hours this would work.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi,
Requirement: In application start,the schedule is triggered and it should generate report by fetching data from database(DB2) and export into word or excel and send a mail daily. This scheduler should work as background process, should not depend on the browser. Windows services or windows scheduler should not be used as per requirement
Please help me in this regard.
Regards,
Manowj
|
|
|
|
|
manowj wrote: Requirement: In application start,the schedule is triggered and it should generate report by fetching data from database(DB2) and export into word or excel and send a mail daily. This scheduler should work as background process, should not depend on the browser. Windows services or windows scheduler should not be used as per requirement
The only other thing that I can think of that could do this would be for you to create a DTS Package and schedule it to run at specific pre-set times.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
I built a online photo album in vb 2005 express site #13
I built a Wrox chat site Site#14
How can I join them together?
|
|
|
|
|
I am not sure I am understanding your goal here. So are you trying to allow users to insert pictures from the photo album in the chat box? Or are you trying to create a seperate chat box for each gallery so that the users can talk about the pictures? Or something else?
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Don't quite follow you. What are you trying to do?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
can any one has done the code for getting FLV file play time length , just like youtube shows for all of its video
modified on Tuesday, December 18, 2007 11:35:00 AM
|
|
|
|
|
|
Show your talent don't give unnecessary commments,forum is for helping others not tried to hitler as u r not the owner of this site. if u know u r welcome , if u didn't don't waste ur time in giving lectures to other.
|
|
|
|
|
Good luck getting help from anyone now. You didn't play by the rules, someone called you on it and you insult him?
|
|
|
|
|
leckey wrote: Good luck getting help from anyone now.
I ditto that.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Judging by your recent posts, you appear to be both ignorant, rude and stupid. That's quite an accomplishment.
I suggest you pay close attention to the forum guidelines and return again when you have mastered the art of forum etiquette.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
pmarfleet wrote: Judging by your recent posts, you appear to be both ignorant, rude and stupid.
That is why I've stopped replying to the person or just give real half-assed replies
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
The web application has a link button which when clicked uses the ID in session and opens ID.doc in another machine.
Here is how I access
http://TestApp/MainPage.aspx, I get the link button and click it and ID.doc opens.
Also, am able to open http://TestApp/Docs/ID.doc [this is the virtual directory path where all the ID.docs reside]
The user should not access http://TestApp/Docs/ID.doc [^]
Do you have suggestions on how to do this?
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
What you can do is to place the file outside of the wwwroot directory, and then stream it to the user when needed. That way the user won't be able to access it directly through a URL.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
|
Michael Sync wrote: If you want the sample, you can check-out this link
http://www.codeproject.com/KB/aspnet/Protect_files_to_downloas.aspx[^]
I guess a simple HTTPHandler approach would be better than this. What do you say ?
|
|
|
|
|
N a v a n e e t h wrote: I guess a simple HTTPHandler approach would be better than this
Yeah. HTTPHandler is much easier than that. no need to touch the IIS setting and just can be done via web.config. but I haven't tried it before..
|
|
|
|
|
Thanks. Took HTTPHandler approach.
------------------------------------------------------------
"The only true wisdom is in knowing you know nothing." --Socrates
|
|
|
|
|
try<br />
{<br />
SqlDataReader reader = null;<br />
components.login comp_login = new Boncet.components.login();<br />
reader = comp_login.checkUser(usernametxt.Text,pwdtxt.Text);<br />
<br />
if(reader.HasRows)<br />
{ <br />
reader.Read();<br />
Session["appeid"] = reader.GetString(0);<br />
Session["emp_id"] = reader.GetString(0);<br />
Session["fname"] = reader.GetString(1);<br />
Session["lname"] = reader.GetString(2);<br />
if(Convert.ToString(reader["mname"]).Length == 0)<br />
{<br />
Session["mname"] = ".";<br />
}<br />
else<br />
{<br />
Session["mname"] = Convert.ToString(reader["mname"]);<br />
}<br />
Session["pword"] = reader.GetString(4);<br />
Session["dept"] = reader.GetString(5);<br />
Session["unit"] = reader.GetString(6);<br />
Session["appraiser"] = reader.GetString(8);<br />
Session["appaid"] = reader.GetString(9);<br />
Session["grp"] = reader.GetString(13);<br />
string userid = usernametxt.Text;<br />
<br />
Response.Redirect("index.aspx?pemp_id=" + userid+"&nam="+Convert.ToString(Session["fname"])+<br />
"&lnam="+Convert.ToString(Session["lname"])+"&dep="+Convert.ToString(Session["dept"])+<br />
"&uni="+Convert.ToString(Session["unit"])+"&grop="+Convert.ToString(Session["grp"])+<br />
"&apaname="+Convert.ToString(Session["appraiser"])+"&apaid="+Convert.ToString(Session["appaid"]));<br />
}<br />
else<br />
{<br />
errorlbl.Visible = true;<br />
errorlbl.Text = "Invalid Staff ID and or Password!!";<br />
}<br />
}<br />
catch(SqlException ex)<br />
{<br />
errorlbl.Text = "System error: " + ex.Message.ToString();<br />
errorlbl.Visible = true;<br />
}<br />
catch(Exception ee)<br />
{<br />
errorlbl.Text = "Wait for some minutes and try again or consult the administrator!";
string datt = ee.Message.ToString();<br />
errorlbl.Visible = true;<br />
}
This code above will sometimes tell the user that null values cannot be called on the method.And it will always be caught by the second catch.Strange thing is that when you restart the IIS, and still use the same ID and pword,the system will accept it and log you on.And after sometime again,it will start telling you that null values cannot be accepted and when u restart the IIS it will be alright again.I have checked all the stored procedures and all the components involved in this login and there is no where a null value can be gotten.I just can't figure out why it is like that.Any help?
|
|
|
|
|
This line will probably throw an error if your returned value from the reader is DBNull.
Convert.ToString(reader["mname"])
I'd also query why you are storing the password in session - should not be necessary.
|
|
|
|
|
no it does not return null.The problem is that itreturns for sometime and then it will start giving this error
|
|
|
|