We are about to start using Reporting Services which will be accessed from a C# ASP.net application. Many reports will have a different where clause for the same report depending upon who the user is and the circumstances. Therefore, I need to be able to send the report a WHERE clause ideally as a string. I can't use hard defined parameters because they will be on different fields depending on how I want to call the report. Can anyone tell me how this is done?
davebarkshire
Posts
-
Reporting Services - How to define the WHERE clause dynamically ? -
Application Settings. How to iterate ?Thanks both for your prompt responses. Case closed.
-
Application Settings. How to iterate ?Visual Studio 2008 / C# / windows application I have some application settings and would like to iterate through them so that I can put them into a list. So far I have not been able to find a way. I've tried to use an enumerator
IEnumerator enuEnumerator = Properties.Settings.Default.Properties.GetEnumerator();
while (enuEnumerator.MoveNext())
{
MessageBox.Show(enuEnumerator.Current.ToString());
}but the string is "System.Configuration.SettingsProperty" Also, I cannot use an indexer because a string is required raher than a number...
Properties.Settings.Default.Properties[i]
Does anyone know how to do this? :confused:
-
How to export a bitmap from a crystal report?I am writing a windows service in c# and am loading a crystal report. I need to export this report as a jpg file to disk or to take some kind of image stream which I can load into a bitmap or image object. I can export to a PDF but this is no use to me. Any ideas?
-
RegisterClientScriptInclude QuestionHello, I'm trying to register two javascript files in my asp.net page and have found that it only registers one of them (always the last one). Is there a way to make it register several js pages programatically? :confused:
ClientScriptManager objClientScript = Page.ClientScript;
objClientScript.RegisterClientScriptInclude("objMainScript",
"../Javascript/neutralMain.js");objClientScript.RegisterClientScriptInclude("objMainScript",
"../Javascript/Wizards.js"); -
How to get the name of my custom control ?Imagine this... I have a custom control and I drag it onto a .net web page. The custom control is given the id 'objMyControl'. In the Page_Load event of the custom control I want to know what the page has called my control. Any ideas?
-
How can I export a crystal report to an image object ?Is there a way to programatically extract an crystal report into c# as an image object?
-
How can I get Page PreRender to work?I have the same signature but it still isn't firing. This is the code in my page.
private void InitializeComponent() { this.PreRender += new System.EventHandler(this.\_Default\_PreRender); } private void \_Default\_PreRender(object sender, EventArgs e) { Label1.Text = "hi"; }
-
How can I get Page PreRender to work?Maybe I'm going mad but I just can't get the PreRender method to fire on a web page. I'm using VS2005 and have created a blank website and have right clicked on the default.aspx page and selected 'View Component Designer' and from there selected the thunderbolt and double clicked PreRender. This created the PreRender method in the 'code behind' and also hooked it up in the InitializeComponent method. If I just put a simple statement in the PreRender method to set the value of a label for example it does not fire. Also, if I put a debug mark in the PreRender method it does not fire. What's going on?
-
DataGridView and Combo Boxes (my brain hurts)I mostly use ASP.net but have spent the day wrestling with a date view grid. I have a column which has a dropdown so when I populate the grid I programatically add a combo (DataGridViewComboBoxCell) to the row and can populate the items with data. The column is a normal DataViewGridTextBoxColumn because I want to have a completely free hand in what I put in the cells in this column. But... the dropdowns have a blank entry at the top which I'd like to get rid of and also there is no property to select an item in the dropdown such as selectedIndex. How han I get rid of the space at the top (blank entry) and how can I set the selected index property? Also, when I want to read the value from the combo and have a reference to the DataGridViewComboBoxCell object in that cell, how do I read the selected value from the combo?
-
Outlook Customise Forms?I am trying to make a form in outlook that I can manipulate to add controls to. I see that each item type is strongly typed and cannot see a generic class that I could inherit from as such. I thought that the OlItemType.olNoteItem would be a simple type and would like to be able to manipulate the form just like it was a windows form. Can anyone point me in the right direction? I can create this note by doing this... NoteItem objNoteItem = (NoteItem)applicationObject.CreateItem(OlItemType.olNoteItem); Now I would like to change the interface of objNoteItem and place buttons and text fields and listen for events.
-
Config file in dll project?I want to keep a connection string in a config file in a DLL project. I have tried using myappname.dll.config and app.config and have stored the data like this... and try to retrieve this data using... strConnectionString = ConfigurationSettings.AppSettings["constring"]; I'm only getting null back. The application doesn't seem to be able to see the config file. ConfigurationSettings.AppSettings.Keys.Count is zero. ConfigurationSettings.AppSettings.Count is zero. Can anyone tell me why this is not working? Thanks in advance - Dave
-
ASP.Net HTML form postback questionChris Unfortunately there is no member under Request called Forms. I do have a member called Form but it doesn't have an Items collection. (Not in C# anyway). I do seem to have cracked it though. Here is what I found...
int intItemId; // Loop for each key in the request form foreach (string strKey in Request.Form.Keys) { // Is this a checkbox key? if (strKey.IndexOf("chk") > -1) // Yes { // Get the id of the checked data item intItemId = Convert.ToInt32( strKey.Substring(strKey.IndexOf("chk") + 3) ); // The user has selected item intItemId. Process that here... } }// end foreach key
-
ASP.Net HTML form postback questionThe problem is that I don't know what the number will be. I need to iterate through all controls that have been posted back and if their id starts with 'chk' then that is the data that I want to process.
-
ASP.Net HTML form postback questionI have an ASP.Net form that has some HTML checkboxes which are dynamically added to the form. I use the ID to identify them but they are generated from data so are different every time. How can I see these checkboxes when I post back? I've tried Request.Form.Controls.Count and see that there are several HTML controls, but I'd like to be able to see the HTML ID and value of these controls. Ideally it would be by using a foreach loop. I can identify them by their ID as the ID starts with the string 'chk'. Am I missing something here? Thanks in advance - Dave
-
Programatically change form action value?Thanks for that valuable information. I would never have guessed! I've been wrestling with dot net for the last 8 months (many hours every day) and I still have to fight it every inch of the way unless I want to do 'hello world' level programs. I sometimes spend weeks doing what I could have done in VS6 in hours! I do like VS7 but find it very complicated still and hope that I don't starve to death before that time comes. (Are you listening Mr Gates???):((
-
Programatically change form action value?Can anyone tell me how to programatically change the html form action value? For example, my page has this form.
I want to change the action value. I have tried this... HtmlForm objForm = (HtmlForm)Page.Controls[1]; which gets me a handle for the form, but I can see no value that will allow me to change the action. Thanks in advance - Dave.
-
Image auto resize not working?Thanks for the help from you all. it does make sense now that i think about it more. I have only one final question. Does anyone have a snippet of javascript or asp.net code that will resize the image?
-
Image auto resize not working?I nearly forgot... The icon in the bottom right corner that usually appears with oversized images does not appear! The browser must think that it's something else because the src attribute of the image tag points to an aspx page.
-
Image auto resize not working?Jesse Thanks for the reply. I hadn't really thought about doing it manually but it would be a possible solution. I just can't understand why pictures from other sites resize automatically whereas by pictures don't. I'm using asp.net to render an image programatically. Here is a picture from a normal website that resises automatically http://www.barkshire.co.uk/bikes/images/Norton18_1931/NortonMod18_1931_RL_low.jpg[^] and here is one from the dot net project that doesn't http://www.barkshire.co.uk/travel/ShowSingle.aspx?URL=Angkor_tree1.jpg[^] There must be something in the way that its streamed down. I wish that there was a client side method that would call the automatic resize. Dave