|
What kind of report server is it? This one
https://msdn.microsoft.com/en-us/library/ms157231.aspx[^]
I think that was poor planning on whoever created the report server and the reports in them.
Guess your just calling a report from the report server, and the report server generates the links in the report.
I would have to see the HTML in the browser, to inspect the format, and then decide what to do.
You could write a JQuery script to load when the dom is ready, and find all the A elements, and loop and inspect to finds the ones you want to change, and change the href attribute value.
If the web server and report server are on the same network, and the reports work, but the access links are different to the public, you should be able to change the links in the report server so all can access it, and the reports generate a new link.
You still didn't give samples of the links, you could just fix the DNS record for it.
But why is this your problem? Your a programer that write code, makes web sites. Unless your the one that made the report server and all the reports.
Maybe this will help
http://stackoverflow.com/questions/12607920/how-to-open-ssrs-report-from-asp-web-page-using-report-viewer[^]
|
|
|
|
|
Hello Experts,
I am generating a function that Exports to Excel using Interop.dll in Vb.net. So Do you think that I need to install office for this on Server machine if I deploy the application? Are there any other things that does export to excel and which will not require Office to be installed on the server machine?
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
"Interop" dlls are just .net wrappers around COM objects that allow your .net code to use the underlying COM objects. For the code to function after being deployed, the COM object the interop is a wrapper for needs to exist, so in your case those objects are provided by Excel, so Excel needs to be installed on the server.
Legal and license issues aside, you're not going to get this working reliable (if at all) and it isn't supported by Microsoft. Look to another way of generating excel files like Open XML, Adpose, the excel odbc driver, DocX etc.
|
|
|
|
|
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
There are various ways to create Excel spreadsheets on the server without using Office interop. For example:
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
Yes, so don't use interop.
|
|
|
|
|
sweet and simple Thank you.
Your help is much appreciated.
Thanks
Happy Coding!
|
|
|
|
|
I use it on Windows Apps, when you turn visibility on, Excel loads, and you can watch the spreadsheet build, and then you can save it.
It's pretty slow, until you start optimizing your code.
So ya, don't use it on a server. But that's how it works.
|
|
|
|
|
|
there are two textbox and i want to perform a search operation on a button click. but the problem is that i am not able to fetch data.
what will be the select query for this.(DB IS MS ACCESS)
my query is like
qry="select * from emp where date_logged between #"+textbox1.text+"# and #"+textbox2.text+"#";
|
|
|
|
|
What is in textbox1.text and textbox2.text? Are you using unambiguous date text like "3 march 2015" or "3 march 2015 00:00:00"? Is "date_logged" a Date field?
As an aside your code is open to sql injection attacks.
|
|
|
|
|
Use & instead of + and also use TextBox1.Value instead of Textbox1.Text
|
|
|
|
|
Your code is vulnerable to SQL Injection[^].
NEVER use string concatenation to build a SQL query. ALWAYS use a parameterized query.
using (OleDbConnection connection = new OleDbConnection("-YOUR CONNECTION STRING HERE-"))
using (OleDbCommand command = new OleDbCommand("SELECT * FROM emp WHERE date_logged Between ? And ?"))
{
command.Parameters.AddWithValue("StartDate", textbox1.Text);
command.Parameters.AddWithValue("EndDate" ,textbox2.Text);
...
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank you guys i will keep that in mind next time.
but I am not able to access data using text box.text. I am using date like mm/dd/yyyy(6/17/2013) format and same is stored in ms access db?
|
|
|
|
|
If you're storing the date as text, then you won't be able to compare it to any other date - for example, the string "6/2/1901 " is greater than the string "6/19/2015 ".
Store your data using a proper data type - Access has a datetime type which you should be using:
Microsoft Access Data Types[^]
If you're already storing the dates as datetime , then you'll need to convert the parameter values to DateTime . For example:
command.Parameters.AddWithValue("StartDate", Convert.ToDateTime(textbox1.Text));
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Using between is not very accurate.
Lets Say you select
01/01/2000 and 01/31/2000
Between will give you
01/02/2000 to 01/30/2000
So you use
WHERE Date >= @StartDate AND Date <= @StopDate
|
|
|
|
|
thank you guys.
|
|
|
|
|
|
Pass?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
AsyncFileUpload disappears when near by asp dropdownlist postbacks, both the controls
are inside update panel
|
|
|
|
|
If you mean the file you selected is forgotten and the upload control blanked when the control is part of an updatepanel then that is normal behavior you can't do anything about. You can't default the file that an upload control points to, and when your updatepanel fires your upload is being deleted then recreated, and it can't be recreated to the same state the way a textbox or dropdown can.
Move the file upload outside of the update panel as they don't work inside asynch update panels anyway.
|
|
|
|
|
I have a task to dsiplay a report using ASP.NET webforms ReportViewer Control. I am using a localreport mode to display the report.
Now when I change something in the search_str parameter which I want to pass teh value from a textbox prompted to the user and click the View Report button, how to refresh or reset the search_str parameter in the button1_click event.
|
|
|
|
|
It comes from the TextBox's value, whenever the button is clicked, you can remove the value from the TextBox; clear it.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I'm baffled by this.
I wrote a contact us page with a form, that writes the info to the table.
I can read the table, but I can't write to it on the production web server.
I can write to the table on my desktop running VS2013 Debug.
So I have 3 other databases on this production SQL server that works fine.
All the other web sites can read and write to the SQL same server.
It's just my first MVC App, that I wrote.
The function runs from the home controller and returns true, and sends the emails.
In web forms, it throws and exception if there's a mistake, but in my MVC app here, it just runs even if there is an error in the SQL.
Like I said I'm just baffled here on this.
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult Contact(ContactModel model, string returnUrl)
{
if (ModelState.IsValid && true == ContactExtender.SubmitContactMessage(model))
{
model.smtp_websiteName = "xxxxxx";
model.smtp_subject = "Contact Us";
model.smtp_sentFrom = "xxxxxx";
model.smtp_sendto = "xxxxxx";
model.smtp_replyto = "xxxxx";
model.smtp_templatePath_website = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/SMTP_Templates/contact_website_template.html");
model.smtp_templatePath_customer = System.Web.Hosting.HostingEnvironment.MapPath("~/App_Data/SMTP_Templates/contact_customer_template.html");
bool website = Contact_Website_Email_Proc.Send_XHTML_Website_Message(model);
bool visitor = Contact_Customer_Email_Proc.Send_XHTML_Customer_Message(model);
ViewData["contactMessage"] = "Success";
}
else
{
ViewData["contactMessage"] = "Failed";
}
return View(model);
}
public static bool SubmitContactMessage(ContactModel cm)
{
bool success = false;
string connStr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
SqlConnection conn = new SqlConnection(connStr);
string query =
"INSERT INTO CRM_MESSAGES " +
"( " +
" Name " +
" , Subject " +
" , CompanyName " +
" , EmailAddress " +
" , Query " +
" , Date " +
" , MailingList " +
") " +
"VALUES " +
"( " +
" @Name " +
" , @Subject " +
" , @CompanyName " +
" , @EmailAddress " +
" , @Query " +
" , @Date " +
" , @MailingList " +
") ";
SqlCommand cmd = new SqlCommand(query, conn);
cmd.Parameters.Add(new SqlParameter("@Name", cm.Name));
cmd.Parameters.Add(new SqlParameter("@Subject", "ContactUs"));
cmd.Parameters.Add(new SqlParameter("@CompanyName", cm.CompanyName));
cmd.Parameters.Add(new SqlParameter("@EmailAddress", cm.EmailAddress));
cmd.Parameters.Add(new SqlParameter("@Query", cm.Query));
cmd.Parameters.Add(new SqlParameter("@Date", DateTime.Now));
cmd.Parameters.Add(new SqlParameter("@MailingList", cm.MailingList));
try
{
conn.Open();
cmd.ExecuteNonQuery();
success = true;
}
catch (Exception)
{
success = false;
}
finally
{
conn.Close();
}
return success;
}
|
|
|
|
|
Your execute statement is inside a try\catch block and if an exception is thrown you just return false so you have no idea what the exception is. Either throw the exception again, or at least log the exception details using something like log4net. If you just want a quick diagnosis then remove the try\catch block and re-compile and deploy and you should see the actual error.
|
|
|
|