|
Thanks..!
You are the Man..!
|
|
|
|
|
I am flattered ...!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi Team,
I am having SSRS project. I have few doubts
1. How to call my SSRs report on click of button in ASP.NET website.
2. How to give connection string when I deploy my application in Test/ Production Server
please guide me
|
|
|
|
|
Hi Siddisagar,
siddisagar wrote: 1. How to call my SSRs report on click of button in ASP.NET website.
Hope you have already designed the SSRS reports and hosted the same on IIS Server.
Now you need to do the following steps .
First : Add Microsoft.Reporting.WebForms namespace with your ASP.NET Web application . This contains methods and properties for the ReportViewer Web server control.
<%@ Register Assembly="Microsoft.ReportViewer.WebForms Namespace="Microsoft.Reporting.WebForms" TagPrefix="SSRSWeb" %>
Second : SSRS viewer assembly will add the ReportViewer control with your web application which you can use to featch the data from SSRS to your aspx page.
<SSRSWeb:ReportViewer runat="server" Width="500px" Height="700px" ID="SSRSViewer">
</SSRSWeb:ReportViewer>
Third : Add Button Click Code Behind For view the Reports
SSRSViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
SSRSViewer.ServerReport.ReportPath = "MyReports";
SSRSViewer.ServerReport.ReportServerUrl = new Uri("http://localhost/ssrsreports");
You are done !!
siddisagar wrote: 2. How to give connection string when I deploy my application in Test/ Production Server
You are talking for ASP.NET web application connection string or what ? I guess you need to change only in config file . Nothing else.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
siddisagar wrote: How to call my SSRs report on click of button in ASP.NET website
Use Report Viewer and display tha report in reportViewer..!
here is the sample code which i done previously
DataView dv = new DataView();
dv = dAccess.GetDataView();
ReportDisplay(dv);
private void ReportDisplay(DataView dv)
{
reportViewer.LocalReport.ReportPath = "Report.rdlc";
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AdventureWorksDataSet_CreditCard", dv));
reportViewer.LocalReport.Refresh();
}
If You have Any More Doubts in ssrs reports Feel Free to ask me..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi
I have a requirement in which i want to create an aspx form in which
I want to define the name of the controls in the xml file and on the basis of the xml file i want to create the aspx form.
if in the xml form there are 10 controls then dynamically 10 controls will be created
i have following type of xml
<MasterType Type="PM">
<Controls>
<Control ControlName="label1" ControlType="Label">
<Value>
this is value
</Value>
</Control>
<Control ControlName="txtName" ControlType="TextBox">
<Value>
this is value
</Value>
</Control>
<Control ControlName="ddlSex" ControlType="DropDownList">
<Value>
this is value
</Value>
</Control>
</Controls>
</MasterType>
if you have any idea please share with me
I will be thankful to you all
|
|
|
|
|
Hi Dharam,
This is quite general scenario where we need to create aspx page at runtime from xml.
Below are the few steps that you need to follow.
Step 1 : Create XML as per requirement of Page . That you are already defined.
Here along with Control Type and name you can also define all other properties. I will suggest you to use different property tag for controls for easily understanding.
Step 2 : Create XSLT style to transform our XML schema
You need to create XSLT in the way where you can iterate through each and every propery of an control.
Note : Using XSLT you can also mention the validation control too.
Step 3 : Now using Code behind Transform XML using XmlDocument and XslTransform
Step 4: Finally Add the output result in page control hierarchy
Control Pagectrl = Page.ParseControl(OutPut);
Page.Controls.Add(Pagectrl);
Hope this will help you to move ahead.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I am relatively new to website design and programming and have been learning both for the past few months. While ASP.Net is awesome, I feel that in terms of website layout and design, Dreamweaver CS4 is superior to Visual Web Studio 2008. I could create a simple but great looking website using Dreamweaver within half an hour, yet find it a bit more difficult to do so using Visual Web Studio (things just don't seem to fall in the right places). What do you guys think?
How about designing the general layout and master page using Dreamweaver, and then put in all the controls/programming in Visual Web Studio?
|
|
|
|
|
It depends on your preference. Whatever you do, the resultant html should be neat, simple and follows all necessary standards.
|
|
|
|
|
Dreamweaver is only for UI designing while VS is designed for multipurpose. So you won't get all the luxury in VS which you have in Dreamweaver. One possible thing is to design the webpage on dreamweaver (or whatever editor you like) and copy the HTML to VS.
Best wishes,
Navaneeth
|
|
|
|
|
HI,
I am creating a questionair form. For that, I have a bunch of radioList inputs on my page. Those are ASP.NET controls. I am trying to call a javascript method which i have defined at the top of the page. But it fails to call that method and gives me some sort of a system is undefined error.
I want to implement that if someone select an option 1 from radiobuttonlist control it should display an image. and if option 2 is selected text should be displayed.
So how can i call a javascript method ??
please help.
|
|
|
|
|
Hi,
just debug it using Visual Studio or IE developer tool.
|
|
|
|
|
I have few issues.
I checekd it and found that it is calling to JAvascript methid, but the problem is that that UpdatePanel does not show the complete HTML. It hides most of the stuff. So how to deal with that.
|
|
|
|
|
I am tasked with discovering a way to programmatically (with HTML and Javascript) interact with an Adobe PDF file and potentially calling JavaScript within the PDF in an Adobe Reader control. I need to find specific documentation either stating the complete how's, in's and out's or an Adobe publication stating that it cannot be done. Unfortunately, the specific keywords involved make Google searching difficult and I have not found Adobe's site particularly helpful. Also, to make this even more interesting, this needs to be done without Reader Extensions so hacking it to use Web Service listeners and callbacks is out, AIR is out, and Flex is out.
|
|
|
|
|
I want to create a HTML page using XML and XSLT but I need to collect an image from the XML file (embedded) and translate it to the XSLT page for include it in the page, any suggestion about how to do it ?
Best Regards
|
|
|
|
|
XSLT is used to have output based on data passed through xml. If you want to show an image, either place the url of the image embedded within the xml or create image in the server and modify xml with appropriate path.
You might also consider to directly write the base64 stream in source of img tag, but it doesnt work in most of the browser nowadays.
<img src="data:image/gif;base64,DASD234AFD+" />
|
|
|
|
|
I dont explain it enough, I have just the image embedded in the XML document, but now I am processing the XML document containing the image with an XSLT stylesheet for creating an HTML page and I want that this page shows the image, so I know that I need:
1) Recover the image from the XML (with binary reader).
2) recover the image in memory (not problem a memoryStream and a BitMap object)
3) send the content of the bitmap to the XSLT stylesheet for include in the HTML page ( this I dont know How).
Best Regards
|
|
|
|
|
Yes.. I got your point.
First of all, XSLT is processed in browser. You just do the logic how the html will be generated and pass the XML. There is no option to generate an image in the browser in XSLT.
If you are going to use embedded image in xml, you need to either transform them in server side to produce image and replace the image path in xml and generate html from that xml... or embed the base64 directly in img src as I mentioned.
I think the first option is good, you need to store the embedded data with image source in the xml before you add xml transformation.
If I was in your situation, I would have used Repeater directly, rather than depend so much in browser using XSLT. Repeater is always better to handle your html as you are sure what you are generating from the server side. You can use OnItemDataBound event to store the image (or directly put in response) and add it to src.
Anyways, you should better choose what suits you. But somehow you have to change the embedded base64 stream to proper image data.
|
|
|
|
|
Really Abhishek, No option to recover the image at client level, so I know that I need to use an binary Reader to recover the Image from the XML file, and store the data in a Stream, later I have two options, save the data to a file using a FileStream, but it's not a good option to save data in client hard disk, so there is also one option of creating a Bitmap object in memory because this object, accepts a stream as data origen, but later I don´t know how to point to the bitmap from the xls, because the image src parameter allways look for a string and not any other object.
I think that this functionality must be very frecuent in News Web Pages which receive a XML with data and Photo and inmediately process them, you told me about an repeater object, I'm going to analyze such possibility.
Best Regards
|
|
|
|
|
Yes...
Another thing that I need to address, images are actually called as a new Request. So for every image request, IIS will spawn a new thread from its ThreadPool and create a Response.
If you can, you can just put the image data into the database or some storage and pass the id to the xml. Create one HttpHandler which will request the image with the id. Say your httphandler is ImageResource.axd .
you write using xslt as :
<img src="ImageResource.axd?id=59" /><br />
Now within the ProcessRequest , write the image data directly in the response stream.
This might be one useful way.
Also it is impossible to store image directly to client hard disk because of security issue in browser. What you can do, is place some Cache headers to the response, and the browser will automatically cache the image to its local storage and will not call the server again if the same resource is called for again.
Cheers.
|
|
|
|
|
Hi ,
On my ascx I have following
<asp:panel runat="server">
In this section...
<asp:label id="Label6" runat="server" text="Label">
<asp:label id="Label7" runat="server" text=" Label">
<asp:label id="Label8" runat="server" text=" Label">
.....
now if I try to access these label controls in my codebehind it says Label doesn't exist in the current context.
I checked the designer file and I even see it in designer file :-
protected global::System.Web.UI.WebControls.Label Label6;
|
|
|
|
|
Restart your visual studio!
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Where is these Labels ?
If it is within the ascx, and you are trying to access it from codebehind of the page where you have added this ascx control, then you would not find the controls directly.
You need to expose them using a property and then use that to set it.
|
|
|
|
|
Thanks..
I restarted my VS twice, yes twice.. !! as the first time it still had same problem.
and then went home for the day. It's working today when I restarted.. grrrrrrrr....
Many Thanks to all.
|
|
|
|
|
Hi All,
I am a newbie to ASP.NET and in need of you help, basically, I have a gridview that binded from two functions (type datatable). One function is parent which I past one parameter ("DeptID") while loading this table I also called the child funtion which get the parameter from the parent function ("FolderID"). The grid bind fine, but my tast is to place a down arrow at the first child row under the parent and an a up arrow at the last child row and the process repeated for each parent that have one or more rows.
This is where I have been banging head head trying to get this work but has no success.
Parent row data1
Down arrow Child row data - first row
up/down arrow Child row data
up/down arrow Child row data
up/down arrow Child row data
up arrow Child row data - last row
Parent row data2
Down arrow Child row data - first row
up/down arrow Child row data
up/down arrow Child row data
up arrow Child row data - last row
Parent row data3
Down arrow Child row data - first row
up/down arrow Child row data
up arrow Child row data - last row
Parent row data4
Child row data - first row
Any assistance is greatly apprecaited. please provide codes example.
Thanks
DocHoliday.
Here are my codes behind VB:
Protected Sub DisplayParentGV()
Dim Conn As New SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("mConn").ToString)
Dim SQLCmd As New SqlCommand("Get_Links_Name", conn)
Dim SQLDBDataReader As SqlClient.SqlDataReader
Dim dt As New DataTable()
Try
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
SQLCmd.CommandType = CommandType.StoredProcedure
SQLCmd.Connection = conn
SQLCmd.Parameters.Add("@DeptID", SqlDbType.Int, 60).Value = Convert.ToInt32(Session("Dept_id"))
dt.Columns.Add(New DataColumn("FolderID", GetType(String)))
dt.Columns.Add(New DataColumn("FolderFileID", GetType(String)))
dt.Columns.Add(New DataColumn("ImageType", GetType(String)))
dt.Columns.Add(New DataColumn("Page", GetType(String)))
dt.Columns.Add(New DataColumn("FolderOrder", GetType(String)))
dt.Columns.Add(New DataColumn("Link_FileOrder", GetType(String)))
SQLDBDataReader = SQLCmd.ExecuteReader()
While SQLDBDataReader.Read()
Dim dr As DataRow = dt.NewRow()
Dim Pid As Integer = Convert.ToInt32(SQLDBDataReader("FolderID"))
dr("FolderID") = (SQLDBDataReader("FolderID"))
dr("FolderFileID") = Nothing
dr("ImageType") = Nothing
dr("Page") = (SQLDBDataReader("Foldername"))
dr("FolderOrder") = (SQLDBDataReader("FolderOrder"))
dr("Link_FileOrder") = Nothing
Session("ParentBottonRow") = dt.Rows.Count
dt.Rows.Add(dr)
Dim ChildTable As DataTable = DisplayChildGV(Pid.ToString())
For Each dro As DataRow In ChildTable.Rows
Dim dr2 As DataRow = dt.NewRow()
dr2("FolderFileID") = dro("FolderFileID")
dr2("ImageType") = dro("ImageType")
dr2("Page") = dro("Link_FileName")
dr2("Link_FileOrder") = dro("Link_FileOrder")
dt.Rows.Add(dr2)
Next
End While
SQLDBDataReader.Close()
Catch ex As Exception
Throw
Finally
SQLCmd.Dispose()
gvParent.DataSource = dt
gvParent.DataBind()
conn.Close()
End Try
End Sub
Protected Function DisplayChildGV(ByVal FolderID As String) As DataTable
Dim Con As New SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings("mConn").ToString)
Dim dt As New DataTable()
dt.Columns.Add(New DataColumn("FolderFileID", GetType(String)))
dt.Columns.Add(New DataColumn("ImageType", GetType(String)))
dt.Columns.Add(New DataColumn("Link_FileName", GetType(String)))
dt.Columns.Add(New DataColumn("Link_FileOrder", GetType(String)))
Dim SQLCmd2 As New SqlCommand("Get_Links_Folder_Name", Con)
Try
If Con.State = ConnectionState.Closed Then
Con.Open()
End If
SQLCmd2.CommandType = CommandType.StoredProcedure
SQLCmd2.Connection = Con
SQLCmd2.Parameters.Add("@FolderID", SqlDbType.Int, 60).Value = Convert.ToInt32(FolderID)
Dim SQLDBDataReader2 As SqlClient.SqlDataReader = SQLCmd2.ExecuteReader()
'SQLDBDataReader2 = SQLCmd2.ExecuteReader()
While SQLDBDataReader2.Read()
Dim dr2 As DataRow = dt.NewRow()
dr2("FolderFileID") = SQLDBDataReader2("FolderFileID")
If Not IsDBNull(SQLDBDataReader2("LinkURL")) Then
dr2("ImageType") = ResolveUrl("~/Images/icon-ie.gif")
Else
Select Case Mid(SQLDBDataReader2("Link_FileName"), InStrRev(SQLDBDataReader2("Link_FileName"), "."))
Case ".xls"
dr2("ImageType") = ResolveUrl("~/Images/icon-xls.gif")
Case ".doc"
dr2("ImageType") = ResolveUrl("~/Images/icon-doc.gif")
Case ".pdf"
dr2("ImageType") = ResolveUrl("~/Images/icon-pdf.gif")
Case ".ppt"
dr2("ImageType") = ResolveUrl("~/Images/icon-ppt.gif")
Case ".txt"
dr2("ImageType") = ResolveUrl("~/Images/icon-text.gif")
End Select
End If
dr2("Link_FileName") = SQLDBDataReader2("Link_FileName")
dr2("Link_FileName") = SQLDBDataReader2("Link_FileName")
dr2("Link_FileOrder") = SQLDBDataReader2("Link_FileOrder")
Session("ChildBottonRowBolean") = SQLDBDataReader2.Read().ToString
dt.Rows.Add(dr2)
End While
Return dt
Catch ex As Exception
Throw
Finally
SQLCmd2.Dispose()
'gvParent.DataSource = dt
'gvParent.DataBind()
Con.Close()
End Try
End Function
|
|
|
|