|
Please check this, if it makes sense.
|
|
|
|
|
where is the report file name in your code? looks like you didn't assigned the report file to report viewer. So you have missed the below line in your code.
psrpt.Load(@"C:\reportname.rpt");
And also other reasons
1. Ensure the RPT file name is correct. Filename must be a fully qualified valid path name (such as C:\MyApp\MyReport.rpt).
2. The ASPNET account has permissions to open the file. Make sure the folder containing the file and the file itself has the same permissions as your application folder.
For more....[^]
|
|
|
|
|
My this Code Working Fine
NomanInternational.Reports.PartyStatementRpt psrpt = new NomanInternational.Reports.PartyStatementRpt();<br />
DateTime start = Convert.ToDateTime(txtdateto.Text);<br />
DateTime end = Convert.ToDateTime(txtdatefrom.Text);<br />
crystalReportViewer1.ReportSource = psrpt;<br />
crystalReportViewer1.SelectionFormula = "{OB.heads}='" + Heads.Text + "' and {Recive.trans_date}>=#" + start.ToShortDateString() + "# and {Recive.trans_date}<=#" + end.ToShortDateString() + "# ";
but when i insert this line
CrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)psrpt.ReportDefinition.Sections["GroupHeaderSection1"].ReportObjects["Text13"];<br />
to.Text = Obcr.Text;
Reports show error
"Load Report Failed"
Please Help Me
|
|
|
|
|
May be try to verify database in report. Confirm the name of the text object. Then try again & let us know.
|
|
|
|
|
Hi,
I have developed an application in visual c# 2010 express on my local PC.
The appplication uses the sql server 2005 express also on my local machine.
Now I would like to install this application on another Machine which is not connected to the Network.
I would like to create a setup on a CD or something so that I can take it to the target machine and install the applpication.
I have not been able to find a guidance on my exact requirement.
can you please point me to the right directions?
Many thanks
|
|
|
|
|
Just create a Deployment project and it will do all the work for you.
It is under New Project...Other Project Types...Setup and deployment. If you look at the Visual Studio Installer tab, there is a wizard which should make it pretty simple.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I checked but it seems that visual c# 2010 express does not have setup or install functionality.
Any work around for this please?
Thanks
|
|
|
|
|
Basically, you will have to do the hard work.
You need to install:
.NET framework for the version your software uses: probably 4.0.
SQLExpress 2005.
Then your app.
The last one is the easy bit: copy all the files from the bin/release folder to somewhere relevant on the target, and hope...
Or upgrade to a paid version of VS? Or buy an installer program? Nasty, but true...
Other than that, I don't know - I have paid versions of VS2008 / 2010 so I haven't needed to try it!
Good Luck!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Hi,
A few questions regarding your reply please:
1- As well as the sql server 2005 express, is there another download for the sql server 2005 express management studio?
2- My files are in the bin\debug folder. Is that ok to copy these ones which include the .dll, .exe, etc...?
3- what do you mean exactly by somewhere relevant on the target machine?
Thank you
|
|
|
|
|
1) Google say "yes": at MSDN. Haven't tried the links because I use 2008 and don't want to risk messing it up!
2) Yes, but I would build the release version and copy from bin\release instead. Should be faster version.
3) "Program Files\MyAppName" would be a good start!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, I will try these steps.
Thanks
|
|
|
|
|
As you've stated that you don't have the Setup and Deployment wizard, why not look into WiX? It's a free installer application - it's not easy to develop, but it is powerful.
|
|
|
|
|
|
Or Inno Setup, though it doesn't make MSIs.
|
|
|
|
|
|
Hello experts,
I'd like to inform users of my software that a value entered in PropertyGrid is not valid.
Since the validity of that value depends on other properties, it's not an option to just don't change the value on user input. Therefore I plan on decorating the value with some error indicating icon.
I created an attribute with boolean value to remember if the error icon shall be shown.
On property value change the icon drawing value is set:
PropertyEditor.CalmdownWarningAttribute.SetValue(typeof(Foo).GetProperty("Speed1"), true);
public static void SetValue(System.Reflection.PropertyInfo property, bool value)
{
object[] attributes = property.GetCustomAttributes(typeof(PropertyEditor.CalmdownWarningAttribute), true);
if (attributes.Length <= 0)
throw new Exception("Attribute \"ShowWarning\" is not set for property \"" + property.Name + "\".");
((CalmdownWarningAttribute)(attributes[0]))._calmdownWarning = value;
}
Then a UITypeEditor is responsible for drawing the icon next to the erronuous value
public class ExclamationTypeEditor : System.Drawing.Design.UITypeEditor
{
public override bool GetPaintValueSupported(System.ComponentModel.ITypeDescriptorContext context)
{
return(PropertyEditor.CalmdownWarningAttribute.IsSet(context.PropertyDescriptor));
}
public override void PaintValue(System.Drawing.Design.PaintValueEventArgs e)
{
if (
PropertyEditor.CalmdownWarningAttribute.IsSet(e.Context.PropertyDescriptor)
&& !PropertyEditor.CalmdownWarningAttribute.GetValue(e.Context.PropertyDescriptor)
)
e.Graphics.DrawImage(InterrollConfigurator.Properties.Resources.Exclamation, e.Bounds);
}
}
And here comes my problem:
The error indicating exclamation icon is always drawn.
I stepped through the code and found that at mark* the value is correctly set to true , but later, at mark**, it is back to its standard value false .
Am I trying a totally wrong approach?
Any hints on how to get icons next to PropertyGrid values changed at runtime?
Ciao,
luker
|
|
|
|
|
I've received a project to replace an old (ASP based) OS Deployment protal with a new one - based on ASP.NET using C#.
Code example:
Function GetResourceIDbyMac(server, mac)
Dim counter:counter = 0
Log ""
Log "WMI Machine Check "
On Error Resume Next
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(server, "\Root\SMS\site_EMEA, username, password)
objSWbemServices.Security_.ImpersonationLevel = 3
Set colSwbemObjectSet = objSWbemServices.ExecQuery("Select distinct ResourceID from SMS_G_System_NETWORK_ADAPTER where MACAddress = '" & mac & "'")
For Each objProcess in colSWbemObjectSet
log "Record found with Resource ID " & objProcess.ResourceID
counter = counter + 1
Next
If err.number <> 0 Then
Log "F:GetResourceID: " & ex.Message
Else
If counter = 0 Then
GetResourceIDbyMac = -1
Else
GetResourceIDbyMac = 0
End If
End if
End Function
I've searched the web and the SCCM SDK but currently I'm unable to understand where and how i should start with this.
Could someone tell me how i can (should) connect to SCCM and get or set data there. A native C# translation of the code lines listed above would be really helpful.
Thanks in advance,
Uwe
(Germany)
|
|
|
|
|
You aren't going to be able to translate that directly: there is (thankfully) no equivalent of "On Error Resume Next" in C#. If your code relies on that, then translation becomes a lot of work, as you have to work out what errors it is masking and code round them...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, maybe i didn't describe my problem (and the wishes) correctly.
I want to write several methods in C# do get data from our SCCM landscape and to update / delete data there. Currently the is an ASP based portal in place and use which should be replaced by a new ASP.NET solution - written in C#.
I don't know what kind of libraries and methods i've to use to recreate a C# solution which contains methods - currently available in the ASP solution. Probably it's not a good idea to "translate" the original code. I'm looking (more or less) for a general answer how i can attach the SCCM landscape and how i can manipulate data there.
Example (old):
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(server, "\Root\SMS\site_EMEA, username, password)
objSWbemServices.Security_.ImpersonationLevel = 3
Set colSwbemObjectSet = objSWbemServices.ExecQuery("Select distinct ResourceID from SMS_G_System_NETWORK_ADAPTER where MACAddress = '" & mac & "'")
For Each objProcess in colSWbemObjectSet
counter = counter + 1
Next
Example (new):
SmsNamedValuesDictionary namedValues = new SmsNamedValuesDictionary();
WqlConnectionManager connection = new WqlConnectionManager(namedValues);
connection.Connect(server, username, password);
connection.ConnectionScope.Path.Path = "\\Root\\SMS\\site_EMEA";
connection.ConnectionScope.Options.Impersonation = ImpersonationLevel.Impersonate;
IResultObject iResult = connection.QueryProcessor.ExecuteQuery("Select distinct ResourceID from SMS_G_System_NETWORK_ADAPTER where MACAddress = '" + mac + "'");
foreach (IResultObject result in iResult) {
counter++;
}
Is that the right way to do what I want ? There are other options available to do this ? I did some trials but wasn't successful. Maybe one of you have a method which can be a good example. I don't expect a complete solution - only a hint.
Best regards and thanks in advance,
Uwe
(Germany)
|
|
|
|
|
Hello
I have a button in a datagridview cell, whenever the datagridview is displayed, the button repeats itself
does anyone know how to avoid that please?
Thank you.
|
|
|
|
|
What do you mean by repeating of button?
Naina
|
|
|
|
|
That is the normal behaviour of DataGridView.
What do you want...?
|
|
|
|
|
If you put DataGridViewButtonColumn in a Datagridview, then each row will have it's own button: this is teh normal behavior and is exactly what I would expect.
What did you expect, and what are you trying to do?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I have researched into "Fluent Interface development", http://en.wikipedia.org/wiki/Fluent_interface[^] and would like to know what the code project community thinks about them...
Do people like using them?
What scenarios would you use them in?
Alternatives?
I use them for objects that require too many arguments or optional inputs.
ICustomerFactory c = new CustomerFluentFactory.Create()
.WithName("James")
.WithID();
|
|
|
|
|
I have seldom written class along those lines, although the very useful LINQ does!
One alternative I like is object initializer:
var o = new MyObject
{
Name = "foo",
ID = Guid.NewGuid(),
Foo = new Bar
{
Snafu = true,
},
};
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|