programatically creating a folder in ssrs using SOAP - reporting-services

I am using the SSRS 2008r API to create and manage SSRS from a webform application. When creating a folder I see where I can add a folder name as well as specify additional meta data (custom properties) that can be a part of the folder. My question is how do I populate additional fields in the catalog database via the api. When I look at the CreateFolder method the only properties I can add at the insert are folder name, path, and custom properties:
rs.CreateFolder(folderName, "/", props); // foldername is a string passed in from the form
However I would also like to set at this time the description, and hidden value.
I'd appreciate any suggestions on how this is accomplished. Every example I have seen within MSDN only shows setting the folder name, path, and custom properties.
thanks in advance

Set the item properties (Description and Hidden) by initializing a Property class for each. Never done it before, but I'm guessing it would look something like this (assuming C#):
...
// description property
Property description = new Property();
description.Name = "Description";
description.Value = "Your description here.";
// hidden property
Property hidden = new Property();
hidden.Name = "Hidden";
hidden.Value = "True"; // not sure on value here, may be True/False, Yes/No
// build properties array
props[0] = description;
props[1] = hidden;
// create folder
rs.CreateFolder(folderName, "/", props); // foldername is a string passed in from the form

Related

Get Route Values in Razor Pages

I want to know how can I get the route values in Razor Pages (Page.cshtml).
Ex.
https://localhost:44320/AdminPanel/Admins
if I was using MVC i would get these datas as
var controller = ViewContext.RouteData.Values["Controller"]; //AdminPanel
var action = ViewContext.RouteData.Values["Action"]; //Admins
How can i get these values in Razor Pages?
For anyone trying to get it you can get it by:
var fullRoute = ViewContext.RouteData.Values["Page"]; // AdminPanel/Admin
Assuming you have a page named AdminPanel.cshtml in your Pages folder, add a parameter after #page on the first line, like this:
#page "{action}"
Then in the code behind (AdminPanel.cshtml.cs), add a prop and a parameter to your OnGet method like so:
private string _action;
public void OnGet(string action) {
_action = action; //now do whatever you want with it
}
You can add a getter if you want to access it in your model back on the cshtml page.
Note: doing the above will make that page require an action be specified. Alternatively, you can also make it optional by adding a question mark (#page "{action?}") and setting a default value in your OnGet (OnGet(string action="")).

Appery.io navigation by passing variable parameter

I'm listing few user details id,name,place,phno using list control form my DB.
My model(userModel) has these 4 items and the array(userList) has some user elements.
Now i use
"ng-repeat user in userList" to populate the data in list.
On click i want to navigate to an update page containing some input fields where i can update that specific users details. For this i need the id. So i'm passing it to the next page.
I've used a scope function updatePage for navigation.
"ng-click updatePage(user.id)"
Inside updatePage function with argument userId:
Apperyio.navigateTo("UpdatePage", {id : userId});
In next page i've taken value as:
var $routeParams = Apperyio.get( "$routeParams" );
var id = $routeParams.id;
I know passing static value as parameters is easy but...
The problem is i'm always getting the same 'id' no matter which row i clicked.
I think the problem is in the function argument passing when clicked.
Please help. I'm a beginner.
Is there any other way to implement such a scenario.
You can share data and functions between pages in Appery Ionic projects using Angular factories.
Click Create New > JavaScript with Name = UserManager and Type = Angular factory.
Set factory code to
define( ['require'], function( require ){
function func( Apperyio ){
var manager = {
userId: null
};
return manager;
}
return [{
/* name for angular resource */
name: 'userManager',
/* type of angular resource */
type: 'factory',
/* angular dependency injection array */
deps: [ 'Apperyio', func ]
}];
});
Then on the 1st page you can set variable before navigating to 2nd page:
Apperyio.get('userManager').userId = user._id;
Apperyio.navigateTo("UpdatePage");
and on the 2nd page you can retrieve it:
var userId = Apperyio.get('userManager').userId;

Referencing binding annotations dynamically in Polymer 1

I'm trying to set up a function in Polymer 1.0 which will allow a JSON response to tell my application which {{BindingVariable}} in which to insert the response. Unfortunately, the syntax for referencing these binding variables seems to be similar to this:this.BindingVariable, which doesn't allow for dynamic variable names.
What I really need is a way to reference these dynamically like how we can reference anything else in the DOM/PolyDOM. For example: document.querySelector('#'+elementID).
Is there any way to reference binding annotations dynamically? I've searched through the entire Polymer DOM and can't find them listed anywhere even though I know they're in the page.
example
app._onResponseRetrieved = function(e) {
for (var key in e.detail.response) {
// none of these work, but they demonstrate what I'm trying to accomplish
// this.key = e.detail.response[key];
// this.querySelector(key) = e.detail.response[key];
// window[key] = e.detail.response[key];
// document[key] = e.detail.response[key];
// Polymer.dom(key) = e.detail.response[key];
}
JSON Sent to _onResponseRetrieved
{"contactFormOutput":"Success!"}
Binding Annotation in index.html
<div>{{contactFormOutput}}</div>
this[key] = e.detail.response[key];
Javascript allows [] on any object for dynamic property referencing

Primefaces PickList update target list on transfer

I want to update the lists in the bean when the user transfers an item from one list to another. Is there a way to do that?
Thx.
In the xhtml:
<p:pickList value="#{myBean.myDepartment}" onTransfer="handleTransfer(e)"....>
In the bean:
List<Department> selectedDepartments = new ArrayList<Department>();
List<Department> availableDepartments = getAvailableDepartments();
private DualListModel<Department> myDepartment;
myDepartment = new DualListModel<Department>(availableDepartments, selectedDepartments);
On Commit, Departments selected by the user can be accessed using selectedDepartments
And the script ...
<script type="text/javascript">
function handleTransfer(e) {
item = e.item;
alert(item.text());
fromList = e.from;
toList = e.to;
type = e.type; //type of transfer; command, dblclick or dragdrop)
}
</script>
I don't exactly know what do you want. This is done automatically same as if you type something into p:inputText it is available in beans property representing the value of p:inputText without need of manual update.
Just access the updated values in your pickList with getTarget() or getSource() methods. You are probably trying to access lists which you provided to DualListModel directly like:
DualListModel<fooType> fooModel = new DualListModel<fooType>(fooList1,fooList2);
// transfer item
// check if fooList2 is updated - this is wrong, it is **not** updated
fooModel.getTarget(); // this way you can get the actual values of target list
target - right side, source - left side of a pickList.

Google Captcha code plugin's parameters not available when in form enctype

I have used Google captcha code and it works well. The form has no enctype too. I wanted to upload images within the same form element. Then an enctype="multipart/form-data" was added to the form's attribute. I faced the following problems and I use JSP servlets:
1.
String challenge = request.getParameter("recaptcha_challenge_field");
String uresponse = request.getParameter("recaptcha_response_field");
here challenge and uresponse gave null values and therefore
ReCaptchaResponse reCaptchaResponse = reCaptcha.checkAnswer(remote, challenge, uresponse);
gave null pointer exceptions.
Edit : I found it later that when enctype="multipart/form-datain form tag is used, parameters and its value cannot be retrieved as request.getParameter('') in Servlet.
2. Then I tried to get values for above parameters (challenge and uresponse) through the FileItem as following
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = null;
items = upload.parseRequest(request);
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if (item.isFormField()) {
String name = item.getFieldName();
System.out.println("name: " + name);
String value = item.getString();
System.out.println("value: " + value); // closing scopes ....
These outputs gave no print results for 'recaptcha_challenge_field' and 'recaptcha_response_field'. But other parameters and values of HTML input elements are available. What I observed is, when the form enctype is removed, servlets can have those parameters ('recaptcha_challenge_field' and 'recaptcha_response_field') and its values. When only form enctype is added, parameters not available in servlets.(request.getParameter('recaptha challenge parameter or recaptha-response-field parameter')).
Edit I checked whether the browser sends those parameters(recaptha-challenge ane recaptha-response-field.) with their values and found that browser sends all parameters well. The problem might be in servlet and getting parameters and values inside the FileItem
I want to upload images with this Google captcha code (for human verifications). My current implementation does not work. Does anyone let me know how to implement this?
The reason is in the html itself. When a input type-file is empty(user hasn't not select a file from the local pc),it is difficult or (cannot be done) to retrieve parameter names and their values (in servelt) of those all below html elements' names in my scenario as mentioned in my problem.