|
hello
In ASP.NET, we can use Report View control to access reports on a Reporting Service instance.
Now,
(1) if I want default PDF format - i.e. without having use to click that "Export to PDF" button in reporting viewer command bar...?
(2) What if some of my own .NET process (MyReportServer.exe) wants to call SQL/Reporting Service directly to export PDF? How do I do that?
Thanks
dev
|
|
|
|
|
how to get only time from this string
string strtime="Tue-07-Jul-2009 12:00 PM";
|
|
|
|
|
|
Set the format of time in which you want to get it.
strtime.format("dd/MM/yyyy");
If you can think then I Can.
|
|
|
|
|
Try like
(1)
string strtime = "Tue-07-Jul-2009 12:00 PM";
strtime = strtime.Substring(strtime.IndexOf(" ")+1,strtime.Length-strtime.IndexOf(" ")-1);
(2)
DateTime dt3=DateTime.Parse(strtime);
strtime= dt3.ToShortTimeString();
himanshu
|
|
|
|
|
string strtime = "Tue-07-Jul-2009 12:00 PM";
string format = "ddd-dd-MMM-yyyy hh:mm tt";
CultureInfo formatProvider = new CultureInfo("en-US");
DateTime dt = DateTime.ParseExact(strtime, format, formatProvider);
Console.WriteLine(dt.ToString("hh:mm:ss tt"));
|
|
|
|
|
Hi Guys,
I tried a lot to figure out how to skip writin onto a particular excel cell using C#, but couldnt get the proper logic.
my eg:
*Team Leader (required) abcxyz User1 user2
Customer Interface Focal dfgidf user23 user3*
each of the names above has to be in a particular cell... but in the excel template, first cell (Team Leader (required)) is readonly, so i cant write into that cell, so my final excel sheet should show
abcxyz User1 user2
Customer Interface Focal dfgidf user23 user3.....
.....
i tried various logics for this... please see the code below
1. Microsoft.Office.Interop.Excel.Workbook SelWorkBook = excelappln1.Workbooks.Open(curfile,
0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, false, false, false);
Microsoft.Office.Interop.Excel.Sheets excelSheets = SelWorkBook.Worksheets;
Microsoft.Office.Interop.Excel.Worksheet excelworksheet = (Microsoft.Office.Interop.Excel.Worksheet)excelSheets.get_Item(CurSheetName);
Microsoft.Office.Interop.Excel.Range excelRange = excelworksheet.UsedRange;
if ((!excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol]).Locked)
{
// Assigning the Value from reader to the particular cell in excel sheet excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol] = values[iValueIndex];
iValueIndex++;
}
but the error shows, in the if statement
Error 1 Operator '!' cannot be applied to operand of type 'object'
so, please say how to handle this case.
Thanks
Ramm
|
|
|
|
|
Krishna Aditya wrote: if ((!excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol]).Locked)
Can you see some incorrect braces here?
Moreover, I cannot see any locked property for cells. However, you can use Microsoft.Office.Interop.Excel.Range.Locked for this.
|
|
|
|
|
ya d@nish,
I used the same Microsoft.Office.Interop.Excel.Range.Locked for test...
if ((!Microsoft.Office.Interop.Excel.Range (excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol])).Locked)
{
/// stuff her
}
it shows error here
Error 1 'Microsoft.Office.Interop.Excel.Range' is a 'type', which is not valid in the given context
Am I using the property wrongly here??
Please help.
Thanks
Ramm
|
|
|
|
|
You are doing it all wrong. Create a Range object for Cell(s) you need to check. Then check locked property.
Read through this[^] code for understanding interop.
|
|
|
|
|
Hi.
I'm developing a small application in C# and I use MS ACCESS database.
Right now the application is 95% done and I'm stucked at a report.
I used MS Report Wizard to create and filter reports and I had no problem till now.
I have to filter a report by date so that it shows only the record from the curent date.
The probloblem is that I tried everything I know but it seams that The Query Wizard in C# does not allow me to use any function for filtering by date.
I used Today(), Now(), CurDate(), SysDate(). Date() but none of them worked.
I'm assuming that this has something to do with date format in VC# and MS ACCESS but I'm not sure.
Since I'm new to C# I considered MS Report Wizard to be a fast solution but I'm not so sure anymore.
Now I have 2 more days to finish the app and I can't find anything to help me solve thios problem.
Any idea or suggestion is much appreciated.
|
|
|
|
|
|
Have you even taken the time to learn any of this yourself? There are tens of thousands of examples on Google and MSDN. Have you even looked there?
At the top of your C# file where the Using directives are, type this (no pasting):
using System.IO;
Now, Assuming you're going to copy that file once a button's been clicked, enter this code into the button's click event:
if( textBox1.Text.Length > 0 )
{
File.Copy(textBox1.Text, @"DESTINATION\path\GOEShere.txt");
} else MessageBox.Show("Please enter filename");
|
|
|
|
|
And you problem is!
You have stated a desire to accomplish something, what have you done towards doing it. Look into the System.IO namespace for the operations you want.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
File.Copy
Have you try to do this yourself or just posted your so called big problem here???
himanshu
|
|
|
|
|
I don't know if this is even possible, but..would be really nice if it were!
I have a solution with multiple projects. The main project has references to these other projects,and presumably is using classes from those other projects. Now I can see from the using section, which namespaces are being used by which files. But I can't tell which classes from those namespaces are being used. Is there any way (direct or indirect) of finding out, from a namespace, which classes are being used inside a file?
thanks
Bijesh
|
|
|
|
|
Hi! how am i suppose to do if i wan to search the data in the database by typing the info in the textbox and it will show the information onto the comboBox?
For example, I type the Employee name into the textbox, then from there, it will search the database and show the contact number of the employee in the combobox.
Is there any way to do it?
I tried using npgsql.dll but it keeps giving errors?
This is the code that i used :
string strConnString = "Server=remote_server;Port=5432;User Id=john;Password=john;Database=testserver";
try
{
NpgsqlConnection objConn = new NpgsqlConnection(strConnString);
objConn.Open();
string strSelectCmd = "SELECT MachineID FROM MachineDeviceMatrix";
NpgsqlDataAdapter objDataAdapter = new NpgsqlDataAdapter(strSelectCmd, objConn);
objDataAdapter.Fill(this.MachineDeviceMatrix);
objConn.Close();
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message, "Error message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
please help, thanks!
|
|
|
|
|
|
|
You can use a form with border set to none and having a label with required text.
This[^] does the same.
|
|
|
|
|
I've thought about that but there should be a simpler way because lots of applications use it.
|
|
|
|
|
Are you tring to figure out how to show the form or how to show it while the program is loading? If you are wanting to show it while the program load, then what i did was loaded the "loading form" at the ever beginning of the other form. then when it was done with all the other stuff I closed the "loading form"
|
|
|
|
|
I am not having trouble on figuring out those, the thing I am wondering is creating a form in that style. I think that form style is built-in Windows as a standart loading screen.
|
|
|
|
|
Do whatever you are doing in load on a separate thread. And while that is executed, set the border of your form to none and hide all the controls. Display just a label to the user with needed text.
This is no different than the previous post of mine except instead of having a separate form, you are doing same thing in the current form itself. This, IMO, is not a good way. You will need to write same thing again and again if there are some more forms which take time to load.
Go for what I had posted earlier. AFAIK it is a decent way to achieve this. I don't know if there is any other way to do this.
|
|
|
|
|
What could possibly be simpler than what you were told to do ? I mean, seriously ?
you need to put it in another thread if you want it to repaint itself while the app is busy. yes, the other apps do that, too
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|