Missing Parameter in Web Service - c#

I am currently working on an Webservice to retrieve a pdf Document from an Crystal Report. As lonmg as there are no parameter Values in the Report, the service works fine. As soon as I use parameters in a Query the Reports can't be shown anymore and I retrieve an error like 'missing parameter values'. But there is only one Parameter and I am pretty sure that I set the value of that parameter...
Here is the Code where I change/ add the value:
// param is a string like 'parametername:value'
string index = param.Split(':')[0];
string value = param.Split(':')[1];
// repDoc is the current Report
repDoc.ParameterFields[index].CurrentValues.Clear();
repDoc.ParameterFields[index].CurrentValues.AddValue(value);
// now i create the PDF as an HTTPresponse
repDoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, response, false, "Report");
I really have no idea why it doesnt work...

Try to debug if param is really set?
I am sure != I checked it

I have found the mistake...
I did a repDoc.refresh() before I created the Report.. seems like the Parameter Values are dropped that way... after removing the Refresh everything works fine :)
thx for the help!!!
Gushiken

Related

iOS iCloud failing to write with, Couldn't get container configuration from the server error

I have one app that I wrote already reading from and writing to the iCloud. I am essentially using the same code in my new app to do the same thing, but for some reason it will not work, giving me the following error, "Couldn't get container configuration from the server". Let me clarify, with this new app it does puts an entry in iCloud under manage storage, but instead of being under the name of my app, it is under adhoc.
Here is the line in my info.Plist,
Here is the line from my Entitlements,plist
lastly, here is my identifier defined on the apple developer site,
I have verified and reverified that everything is pointing to the correct thing so I am baffled. Any help would be much appreciated.
EDIT I guess what it is doing is writing file to my phone, but when it goes to save data to it, it fails with this message, Here is my call to save the data.
CKRecordID recordID = new CKRecordID(strDate);
await Task.Delay(200);
// Save it to iCloud
await pvc.SaveToiCloud(newRecord);
Here is my code to save the record,
public async Task SaveToiCloud(CKRecord newRecord)
{
ThisApp.PrivateDatabase.SaveRecord(newRecord, (record, err) =>
{
Edit:
I was thinking that possibly the number of nodes I had was too many, so I took out the "dist" one you see below, but that did not help. I thought maybe that was why I was seeing module name of adhoc under icloud on my phone, but I guess I was wrong.
Old:
New:
Edit
I have been doing more digging and found that this line of code is actually the one throwing the error.
File.WriteAllText(Path.Combine(filePath.Path, name + date), "Test");
The name and date contain correct values and the path looks fine to me... I guess... Don't know actually how it should look. Here is how the file path is getting set right above this call,
NSUrl filePath = NSFileManager.DefaultManager.GetUrlForUbiquityContainer(null).Append("Documents", true);
If anyone could offer any advice, I would be most appreciative.
So, I finally figured out the issue and it works like a champ now. The issue was the case in my bundle id in my info.plist. In CloudKit the DB name was all lower case, but my bundle Id in my info.plist, had AdHoc as my last node instead of adhoc as was in the CloudKit. You might say, what does the bundle Id have to do with the iCloud name, and actually I am not really sure, but I noticed that it was taking the case of that last node from my Bundle Id, not the case specified in the iCloud definition as I have shown above. Hope this helps someone who is struggling with a similar issue Have a great day!

Cannot save content with an empty name on content save at controller level in Umbraco 8

I am getting this error on saving and Publish "Cannot save content with an empty name" at controller level in Umbraco 8
I have a simple method in surface controller after form submit, which has a file upload and name and email, but after save and publish, I get this error that "Cannot save content with an empty name"
IContentService contentService = Services.ContentService;
var content = contentService.CreateContent("samplename", udi, sample.ModelTypeAlias);
content.SetValue("entry", model.FileUpload);
contentService.SaveAndPublish(content);
Before this it worked fine in umbraco 7 for me.
Does it work when you give the node a name? I'm thinking that all Umbraco content (at least as a rule of thumb) needs a unique URL, which cannot be created if the node has no name. Might be a new sanity check for v8, but a good one as far as I see it.
CreateContent() only sets the Node name, but not the culture specific name of the content.
You will need to use SetCultureName(). This method sets the culture sepcific name, which is the empty name value that the error is complaining about on the SaveAndPublish()
IContentService contentService = Services.ContentService;
var content = contentService.CreateContent("samplename", udi, sample.ModelTypeAlias);
// You will need to set the culture specific name
content.SetCultureName("sampleName", culture)
content.SetValue("entry", model.FileUpload);
contentService.SaveAndPublish(content);
So for anyone facing the same issue, the answer i found was to set the culture if u have multi cultures enabled for your site
contentService.SaveAndPublish(content, "en-US");

Setting/Passing a Value to a Parameter to a Crystal Report in c# is Not Working

I have 2 parameters (Detail, Summary) that I have created in a Crystal Report. The report is called from c# in a Windows Forms application. I am trying to pass the appropriate value to each parameter at runtime so the report can make some decisions based on the values. I have read many articles regarding this and I think I am using the best method to accomplish this?
This is the simple code I have implemented after the report has been loaded and before the SetDataSoruce has been set:
crReportDocument.SetParameterValue("DetailView", false);
crReportDocument.SetParameterValue("SummaryView", true);
For some reason the values are not getting to the report as the report is always prompting for the values to be set when it runs.
Everything else about the report works correctly.
I would appreciate any light someone can shed on this matter as it seems to be a simple task to do?
Actually the problem was code placement. I was populating the parameters in the wrong place of code execution:
This is how I had it when it was not working:
crReportDocument.SetParameterValue("FromDate", dtmFromDate);
ReportViewer reportViewer = new ReportViewer();
reportViewer.ReportSource = crReportDocument;
To resolve I moved the code around as follows:
ReportViewer reportViewer = new ReportViewer();
reportViewer.ReportSource = crReportDocument;
crReportDocument.SetParameterValue("FromDate", dtmFromDate);
That's all it took to get it to work correctly.
Let me know if it does not work for you.
The problem is that the parameter must be passed using format {?PARAMETER}.
It works.
crReportDocument.SetParameterValue("{?DetailView}", false);
crReportDocument.SetParameterValue("{?SummaryView}", true);

Google Drive API Get VideoMediaMetadata Error

I wonder why it gives me an exception of invalid parameter when i request the details of a file which is a video and want to get its resolution. I use:
var f = service.Files.Get(id);
f.Fields = "VideoMediaMetadata.Height";
var result = f.Execute();
I tried many different ways: "VideoMediaMetadata" without ".Height", "VideoMediaMetadata(height, width)", "VideoMediaMetadata/Height" etc. but nothing worked. When i do this for example:
f.Fields = "id, name, size";
It works fine.
Appreciate the help
It gives off an invalid parameter because GET was expecting a VideoMediaMetadata object resource but you instead tried to access the int values. I suggest passing VideoMediaMetadata as your parameter first and execute the request. After that, parse the response body for the 'height' and 'width' int property.
So using your code above:
f.Fields = "VideoMediaMetadata";

How to block the enter parameter value prompt from crystal report? [duplicate]

I am having a terrible problem with crystal report 2010 for .net 4.0 (I am using the fixed 13.0.1 version but 13.0.4 is released). No matter which way I try, I am always getting a prompting dialogue box to input my one parameter value the first time.
CrystalReportViewer1.ReportSource = CustomerReport1;
CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset);
CustomerReport1.SetParameterValue("PathLocation", Location.Text);
CustomerReport1.Parameter_PathLocation.CurrentValues.Add(Location.Text) // to be safe using CS 2010 for .net 4
CrystalReportViewer1.ReuseReportParametersOnRefresh = true; // to prevent from showing again and again.
I also tried this:
CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset);
CustomerReport1.SetParameterValue("PathLocation", Location.Text);
CrystalReportViewer1.ReportSource = CustomerReport1;
And this:
CustomerReport1.Database.Tables[0].SetDatasource ( this.dataset);
CustomerReport1.Parameter_PathLocation.CurrentValues.Add(Location.Text)
CrystalReportViewer1.ReportSource = CustomerReport1; // the parameter in the report has Optional Parameter = false, Static , Multiple Value = false .
Can anyone please help? I am getting frustrated with this. It worked in previous versions, but now I am getting this prompt box.
Thank you.
Finally found the solution. It doesn't prompt if we set the DataSource after the ParameterValue.
So anyone of those will work if we put them in this order:
// First, call SetParameterValue. Then, call SetDatasource.
CustomerReport1.SetParameterValue("PathLocation", Location.Text);
CustomerReport1.Database.Tables[0].SetDatasource(this.dataset);
CrystalReportViewer1.ReportSource = CustomerReport1;
Thank you all.
create the parameter but do not assign it a formula using selection formula -> record. Apply this parameter from vb or c#.net IDE by creating a text box,a label and a button. Put the selection formula on click button procedure.

Categories

Resources