SSRS Switch Case Default Value
Hi
I am preparing a chart in my report. My problem is default value of switch statement. I want to hide the default value on my chart.
My expression in category group is below. Totally, there are 4 statuses. However, I just use status 1 and status 2.
Switch(Fields!status.value=1,"New order",Fields!status.value=2,"Order",true,nothing)
When I execute the report it displays "New order" and "Order" correct. But also displays me default value. I just want these two values. I don't want to display the third one on my chart. How can I hide statuses except 1 and 2 ?
KAdir
Hi KAdir,
If I understand correctly, you want only display the first and second category values in the chart. In your case, we can use IIF() function to work around the issue.
Please refer to the following expression in category group:
=IIF(Fields!status.value=1,"New order",
IIF(Fields!status.value=2,"Order",Nothing))
Then, use following expression to replace the Values' expression:
=IIF(Fields!status.value=1 or Fields!status.value=2,
Fields!Details.Value,0)
There is a screenshot for your reference:
If there are any misunderstanding, please feel free to let me know.
Regards,
Alisa Tang
If you have any feedback on our support, please click
here.
Alisa Tang
TechNet Community Support
Similar Messages
-
Hi,
in my ssrs report i have two parameters, accounts and Manager ,there is a cascading between the accounts parameter and manager parameter, as per the cascading we will get managers names based on the account we selected in the accounts parameter,
my requirement is the first name in the mangers drop down list has to get selected as default value.
please help me with this, it is an urgent requirement.
Thanks in advance,
NaveenHi NaveenMSBI,
According to your description, you want to use cascading parameters in the report, if the accounts are selected when you preview the report, the first manager name will be selected from drop down list as the default value. If so, there can be two scenarios:
• If manager is single-valued parameter, we can get Available Values and Default Values from the same query as below. Then when the accounts are selected, the first manager name will be selected as default value.
SELECT managerName FROM table_name WHERE accounts IN (@accounts)
• If manager is multi-valued parameter, we need to use different query for Available Values and Default Values. In this case, please refer to Patrick’s solution.
For more information about Adding Cascading Parameters, please refer to the following document:
http://technet.microsoft.com/en-us/library/aa337498(v=sql.105).aspx
If you have any questions, please feel free to let me know.
Best Regards,
Wendy Fu -
Switch/Case: How to test byte values in hex format
OK, this may be a silly question, but being new to Java, I can't seem to get this to work.
I have a byte value that I want to test in a switch/case statement. The value was assigned to the byte in hexadecimal format. However, testing only works if I use the decimal value of the byte!
What's even stranger: It does work in a simple if/else statement. In my debugging attempts, I discovered this using the following code:
//*temporary debug routine
memoryCells[0] = (byte) 0x86; //LDA
if(memoryCells[0] == (byte) 0x86)
System.err.println("byte recognized as hexadecimal!");
else
if(memoryCells[0] == -122)
System.err.println("byte recognized as decimal!"); So, this works in an ordinary if/else statement, but why doesn't it also work in the complex switch/case statement? Snippet below:
switch (currentOpcode)
case (byte) 0x86:
//*LDA immediate (2 bytes, 2 cycles)
registerA = b;
currentOpcode = 0x00;
cycleCounter = 0;
break;
}Thanks in advance for any suggestions...public static void main(String[] args) throws Exception {
byte test = (byte)0x86;
switch(test)
case (byte)0x86:
System.out.println("Success");
break;
default:
System.out.println("ooops");
}This works for me.
~Tim -
Can I test (junit) default case of switch-case statement ?
Hi,
I have a class which has switch-case statements and I am trying to junit test with 100% coverage. My switch-case workes based on enum values.
say my enum values are 1, 2.
switch(getEnumValues) {
case 1:
return "some value";
case 2:
return "some value";
default:
throw new UnsupportedOperationException("No such enum value supported.");
I have test case to test the case 1 and 2 but I am not able to test default case. Can anyone please let me know how can I right a junit test case for default case.
Edited by: TUIJAVADEV on Nov 4, 2008 4:15 PMyawmark wrote:
TUIJAVADEV wrote:
I have test case to test the case 1 and 2 but I am not able to test default case. Can anyone please let me know how can I right a junit test case for default case.If your enum values are ONE and TWO, and you have cases for both, then there is no "default case". There is nothing to test.
~If I'm reading the OP correctly, they're 1 and 2, not ONE and TWO. That is, not values of a Java enum.
If this is the case, then the easiest way to test the default case is to break the swtich out into a separate, package-accessible method that takes and arg and passes that onto the switch. (There may be variations on this, depending on how your code is structured.)
However, in a similar vein to what the others are saying, if you already know that you'll only ever have 1 and 2 by the time you get to the switch (maybe because the value comes from an argument to the enclosing method, and you've already unit tested that it appropriately throws an IllegalArgumentException when other values are passed, then there's no need to test the default.
Finally, though if it is ints 1 and 2, rather than a true enum, why not switch to an enum? -
Ssrs 2008 want parameter default values to display
In an ssrs 2008 report, I want to add a parameter called Processed and have default values set so the
user does not have to select the parameters. The problem is the default parameters are not preselected
when the report is executed.
The following is the query for the dataset that is used for the parameter called Processed. This
is used under available values.
select DISTINCT IsNull(Processed,'') as Processed,
CASE IsNull(Processed,'')
WHEN 0 then 'Non Processed'
WHEN 1 then 'Processed'
END AS label
FROM [Items]
where Processed in (0,1)
order by label
The default values are set to 0 and 1.
The column called Processed as defined as 'bit'.
Thus can you tell me what you think could be wrong? Do I need to specify the bit values as
something else? If so, how should I refer to the values for bit?Hi wendy,
According to your description, this issue can be caused by the values returned by the query. We can try to execute the query in Query Designer to check which values will be returned. Maybe it only returns one value (0 or 1). Then the available values for
the Processed parameter have only one value. So the default values will not be preselected when the report is initially run.
Besides, we can also try to use the same query as the default values for the parameter to check the issue again.
Hope this helps.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
Ssrs parameter default value not showing ,when available values is binded to query dataset
I have developed a report using sql server data tools for vsiual studio2012 ,i have defined few parameters ,on one of the parameter when available values is binded to a dataset query, the report default value is not showing in report preview .
Many Thanks
ChandraHi Chandra,
According to your description, you have set the default value for a parameter, but it's not displayed when initially running the report. Right?
In this scenario, since you have set the available values bind to query, so your default values should be within these available values. If these default values are not within the available values, the default values will be not displayed. So please check
the default values.
Reference:
Add, Change, or Delete Default Values for a Report Parameter (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
SSRS 2008 R2 Report parameters have default values and report not to auto run
Hi, I am using SSRS 2008 R2 one of my requirements for a Report is all the parameters have default value and I do not want this report to auto run when users open this report. I can create a dummy hidden parameter to break the auto run for this
report. But I am looking for solutions other than that.
Thanks in advance..........
IoneHi lone,
According to your description, you have a report with parameters. Now you want you report not to run automatically with your parameters default values. Right?
In Reporting Service, if you have parameters with default values in your report, your report will always auto run with these default values. We can say these default values are used for report running initially. So for your requirement, if you really need
to see your default value before the report running, the best workaround is set one more parameter to break the auto run like you have done. If you just want your report not to auto run, your can achieve it by removing those default values.
Reference:
Report Parameters (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou (Pactera) -
Switch partitions and default values
MSSQL 2012
Can I switch partitions when the target has default value for a column, but the source doesnt? if so, will the default values be applied?
ThanksHello,
Do a simple test:
CREATE TABLE dbo.Source (id int NOT NULL, updatestamp datetime NULL)
CREATE TABLE dbo.Destination (id int NOT NULL, updatestamp datetime NULL DEFAULT(GETDATE()));
GO
INSERT INTO dbo.Source (id) VALUES (1);
GO
ALTER TABLE dbo.Source SWITCH PARTITION 1 TO dbo.Destination;
SELECT *
FROM dbo.Destination;
Yes, it works.
No, during a Partition Switch the data won't be modified.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Allowing Default Values OR typed values in a SSRS Report Parameter
Hello,
I'm able to set a parameter while designing a SSRS report to use a list of values or I can chose to specify no values. In the latter scenario when actually running the report the value can be typed instead of selected.
What seems impossible is to allow (while running) the user to type a value but also having the option of using default values. It seems if the options for default or available values are entered with information while designing the report, the ability
to type values into the report while running it is taken away.Hi ebs_software,
Per my understanding you want to know if there is any method to type the parameter values and also can select a value from the drop down list, right?
Generally, by default, when you haven't specify the "Available values" you will able to type an value in the parameter input textbox, or you will not able to do this. For the field of "Date/Time" type when you haven't specify the "Available
values", you can pick up the date from the calendar picker and also can type the value in the textbox.
Thanks for your understanding!
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support -
SSRS Cascading Parameter Setting Default Value of Parameter by Expression
Hi All,
I need some help on an issue I am running into in SQL server 2008 report parameters. I have the following Report Parameters defined:
1) @PredefinedDateSelection - Boolean (User Selectable True/False, Default Value - 'False')
2) @StartDate - Text (User input text box)
If @PredefinedDateSelection = TRUE, then I would like to provide a particular default value to the StartDate textbox (i.e. @StartDate Default Value), If @PredefinedDateSelection = FALSE, then I would like to provide a different default value.
I have the following code for the Expression for the Default value of @StartDate: =code.GetStartDate(Parameters!PreDefinedTimeSelection.Value)
where GetStartDate is a very simple VB function defined as :
Public Function GetStartDate(x as boolean ) As String
Dim a as string
Dim b as string
a = "Report Uses Predefined Values"
b = "Please Input Value"
If (x) then
Return a
else
Return b
end if
end function.
Now the default value of @StartDate stays set as "Please Input Value", and does not change when I toggle @PredefinedDateSelection from False to True and vice versa. I was expecting to see the Default value to change between the two messages depending on my selection in the report preview.
Another parameter which is a dropdown and uses a dataset to display two different set of selectable items depending on the value of @PredefinedDateSelection is working just fine. I am not sure if I am missing something or I am doing something wrong.
Instead of using the VB code I also tried : =iif(Parameters!PreDefinedTimeSelection.Value = True,"Report Uses Predefined Values","Please Input Value")
I also tried changing the default value using a dataset with SQL query and the available value set to NONE, so that the user could input. But the Default value does not refresh or change values.
I hope I have explained my question clearly. I would really appreciate any thoughts and comments.
Thanks,
AruneshThank you much for your response.
I tried that and it did work. But my requirement is to have a user input the date. The basic idea is if the user decides on a predefined time range like Day Shift Today or Yesterday and so on... then the report would automatically calculate the values based on predefined date time values. On the other hand, if the intent is to run the report for an arbitrary period then the user supplies the date and time limits.
What I am trying to achieve is have the same parameter available for user input , but when the User decides he wants Predefined then the "textbox" populates with date and time as per his choice of predefind range.
I understand that by this the user can still overwrite the date and time on the text box, but the report will run the predefined values as long as he has the @PredefinedDateSelection Set to true.
Is there a way I can impement this?
Once again I thank you and appreciate your input. -
Default Value , Not Null and EJB2.1
Hi ,
Am using Weblogic10.3 + Oracle Db + EJB2.1 Local Entity Beans .
The issue is that one of the table has createdDt which is not null and is defualt is set to Sysdate. When I try to create this Entity with createdDt null , I get an exception like below , But since I have mentioned default value , I shouldnt be getting this. Have I missed something ?
Code is quite straighforward
Organisation org = organisationHome.create();
....org.setter methods..
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
ErrorCode=1400 SQLState=23000
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
at weblogic.jdbc.oracle.OracleImplStatement.execute(Unknown Source)
at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
at weblogic.jdbcspy.SpyPreparedStatement.executeUpdate(Unknown Source)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:159)
at weblogic.ejb.container.manager.BaseEntityManager.executeInsertStmt(BaseEntityManager.java:763)
at weblogic.ejb.container.internal.TxManager$TxListener.executeInsert(TxManager.java:900)
at weblogic.ejb.container.internal.TxManager$TxListener.executeDBOperations(TxManager.java:831)
at weblogic.ejb.container.internal.TxManager$TxListener.beforeCompletion(TxManager.java:1054)
at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1217)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1195)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:118)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1302)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2114)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:263)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:621)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:60)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:441)
at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl.createOrganisation(DomainServices_7p8lqs_EOImpl.java:7717)
at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)parmTest( , "param2") is syntactically incorrect, so there can be no "workaround".
In addition to solutions offered by SwapnilVJ and Saransoft84, you could also use a rest parameter:
function parmTest(... args)
// set up default values
var val1:Boolean=true;
var val2:String="";
switch(args.length)
case 0:break;
case 1:
if(args[0] is String){val2=args[0] as String;}
else{val1=args[0] as Boolean;}
break;
case 2:
default:
val1=args[0] as Boolean;
val2=args[1] as String;
break;
trace(val1 + " " +val2);
parmTest();
parmTest("hello");
parmTest(null,"hello");
parmTest("hello",null); -
Difficulty in using switch-case
I want to display certain labels on the basis of the value supplied in switch .But it's not working . I don't know how to overcome the problem .Kindly guide me.
My page is as follows:
<html>
<head>
</head>
<body>
<%!
int i=1;
%>
<%
switch(i)
%>
<%
case 1:
%>
In case 1.
<%
break;
%>
<%
case 2:
%>
In case 2.
<%
break;
default :
%>
</body>
</html>The JSP interpreter is putting in statements which makes your code not compile.
This is caused by the carriage returns in your jsp code.
switch(i)
out.print(__constantTable.getString(103)); // *** Syntax: SwitchLabels expected after this token
case 1:
out.print(__constantTable.getString(165));
break;
out.print(__constantTable.getString(98)); // *** unreachable code
case 2:
out.print(__constantTable.getString(166));
break;
default :
}Solution
1 - Don't mix scriptlets and jsp code in this way. Particularly closing %> and then opening again.
The following will work
<%!
int i=1;
%>
<%
switch(i){
case 1:
%>
In case 1.
<%
break;
case 2:
%>
In case 2.
<%
break;
default :
%>2 - a better solution is to use a custom tag, or tag library like JSTL to implement this
<c:choose>
<c:when test="${i == 1}">In Case 1 </c:when>
<c:when test="${i==2}"> In Case 2 </c:when>
<c:otherwise> Default value </c:otherwise>
</c:choose>Cheers,
evnafets -
Ssrs 2012 change parameter values
In an existing SSRS 2012 report, I have a requirement for a user to be able to select by multiple school(s) and/or multiple grade(s). This is fine except certain schools like elementary have grade levels of KG to 06, Middle school has grades of 06 to 09
and high school has grades of 10 to 12. Thus for example, if a user has initially selected grades 11 and 12 and then they select an elementary school that has grades KG through 06, the 'grade level' selection would need to change.
In other words, I am thinking of initially having the available and default values for the parameter called 'Grade' set to KG through 12. However if a school is selected that only has specific grade levels like elementary school, how can I override
the original grade level and only allow the user to select grades that the particular school contains?Hi Wendy,
Per my understanding that you have two multiple value parameters "School" and "Grade", you have specify the available values and default values for these two parameters, now you want to value which displayed in the
dropdown list of Grade depende on the selection in the School parameter, right?
I have tested on my local environment and you can create cascading parameter for Grade, for example, when you select "Elementary" in the School the grade dropdown list will display "1,2,3,4,5", when you select the "Middle",
the grade will display "6,7,8,9", when you select the "High", the grade will display "10,11,12".
If this is case, please reference to the details information below to achieve this:
1. Create an new dataset2 and use the query below to get the values from this query for the parameter School:
select distinct a.School from
(SELECT 'Elementary' AS School, 1 AS grade
UNION
SELECT 'Elementary' AS School, 2 AS grade
UNION
SELECT 'Elementary' AS School, 3 AS grade
UNION
SELECT 'Elementary' AS School, 4 AS grade
UNION
SELECT 'Elementary' AS School, 5 AS grade
UNION
SELECT 'Middle' AS School, 6 AS grade
UNION
SELECT 'Middle' AS School, 7 AS grade
UNION
SELECT 'Middle' AS School, 8 AS grade
UNION
SELECT 'Middle' AS School, 9 AS grade
UNION
SELECT 'High' AS School, 10 AS grade
UNION
SELECT 'High' AS School, 11 AS grade
UNION
SELECT 'High' AS School, 12 AS grade)a
2. Create the dataset3 and use below query to get the values from this query for the parameter grade:
SELECT a.grade
FROM (
SELECT 'Elementary' AS school, 1 AS grade
UNION
SELECT 'Elementary' AS school, 2 AS grade
UNION
SELECT 'Elementary' AS school, 3 AS grade
UNION
SELECT 'Elementary' AS school, 4 AS grade
UNION
SELECT 'Elementary' AS school, 5 AS grade
UNION
SELECT 'Middle' AS school, 6 AS grade
UNION
SELECT 'Middle' AS school, 7 AS grade
UNION
SELECT 'Middle' AS school, 8 AS grade
UNION
SELECT 'Middle' AS school, 9 AS grade
UNION
SELECT 'High' AS school, 10 AS grade
UNION
SELECT 'High' AS school, 11 AS grade
UNION
SELECT 'High' AS school, 12 AS grade) AS a
where a.school in (@School)
3. Create two parameters "School" and "Grade" check the "Allow Multiple Values" and also set the "Availble values" and "Default values" by select the "Get values from a query" as below:
4. Preview as below:
More details information about add Cascading Parameters to a Report:
Add Cascading Parameters to a Report (Report Builder and SSRS)
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
Need help with switch/case
Thanks in advance.
I read the tut on switch statements. My assignment is asking me to do something that is not detailed in that explanation ;
I have a total of 5 case statements, 1-4 and a default statement. The instructions for them are as follows:
Case 1: If the user enters a 1, display a message that informs users they are correct, as any input canbe saved as a String. Enter the break statement.
Case 2: If the user enters a 2, parse the value into tryInt. Display as message that informs the users they are correct. Enter the break statement.
Case 3. If they user enters a 3, parse the value into tryDouble. Display a message tha t informs users they are correct. Enter the break statement.
Case 4: Set done equal to true. Enter code to display a closing message. Enter a break statement.
Case default: throw a new NumberFormatException.;
Here is the code
import java.io.*;
import javax.swing.JOptionPane.*;
public class MyType1
public static void main(String[] args)
//declaring variables
String strChoice, strTryString, strTryInt, strTryDouble;
int choice, tryInt;
double tryDouble;
boolean done = false;
//loop while not done
while (!done)
try
choice = Integer.parseInt(strChoice);
switch(choice)
case 1:
JOptionPane.showMessageDialog(null,"You are correct!");
break;
case 2:
choice = Integer.parseInt(tryInt); JOptionPane.showMessageDialog(null,"You are correct!");
break;
case 3:
choice = Double.parseDouble(tryDouble);
JOptionPane.showMessageDialog(null,"You are correct!");
break;
case 4:
done = true; JOptionPane.showMessageDialog(null,"Goodbye!");
break;
As usual Im doing something wrong. Please help.Thanks for your input. The directions for the assignment tells me to first declare the variables.
Begin a while(!done) loop to repeat as long as teh user does not click the Cancel button.
Inside a try statement, enter code to display an input box with three choices.
Type choice = Integer.parseInt(strChoice); on the next line to parse the value for the choice entered by the user.
(HERE THE SWITCH STATEMENT WITH CAST STATEMENTS)
Close the switch statement with brackets
Create a catch statement.
import java.io.*;
import javax.swing.JOptionPane.*;
public class MyType1
public static void main(String[] args)
//declaring variables
String strChoice, strTryString, strTryInt, strTryDouble;
int choice, tryInt;
double tryDouble;
boolean done = false;
//loop while not done
while (!done)
try
String message = "What is My Type:" + "\n\n1) String\n2)Integer\n3)double\n4)Quit the program\n\n";
choice = Integer.parseInt(strChoice);
//test for valid choice 1, 2, 3, or 4
if (choice<1 || choice>4) throw new NumberFormatException();
else done = true;
switch(choice)
case 1:
JOptionPane.showMessageDialog(null,"You are correct!");
break;
case 2:
choice = Integer.parseInt(tryInt); JOptionPane.showMessageDialog(null,"You are correct!");
break;
case 3:
choice = Double.parseDouble(tryDouble);
JOptionPane.showMessageDialog(null,"You are correct!");
break;
case 4:
done = true; JOptionPane.showMessageDialog(null,"Goodbye!");
break;
catch (NumberFormat Exception e)
JOptionPane.showMessageDialog(null, "Please enter a 1, 2, 3 or 4:", "Error", JOptionPane.INFORMATION_MESSAGE);
}Typing this now, I see I dont have anything in my try statement entering code to display an input box with three choices.
(PS. I know I would write a catch statement for the NumberFormatException, but why would I also write this exception in the case statement also??) -
Default value don't get displayed for Fetch XML report
Hi All;
i have a date parameter in a fetch XML report
i set its default value as 01/01/2010
when i run this report in SSRS i can see the default value of the date
But when the same report gets displayed on CRM 2013 online - report section the date default value dont get displayed
Any help for this much appreciated
Thanks
Pradnya07Hello Zero-G. _,
>> But I don't get any "Operation". I can't see my failure. - I tested around for the last few days, but I don't have a Clou, what's wrong...
I am afraid that you have mixed the WCF and WCF Data Service, here is a WCF Service example(it works with the Entity Framework while it is not WCF Data Service):
http://www.codeproject.com/Articles/127395/Implementing-a-WCF-Service-with-Entity-Framework, please check it, in your case, you are use this mode and you do not need to create WCF Data Services.
If you want to write a custom method in WCF Data Service, you could refer to this link:
https://msdn.microsoft.com/en-us/library/dd744841(v=vs.110).aspx, as you can see, although if we declare a custom method, it would not show in the web browser, we call it as adding
the method after the based service link directly:
http://localhost:12345/Northwind.svc/GetOrdersByCity
Or call it by using a client project which could detect this method and call it as in this blog:
http://blogs.msdn.com/b/dataaccesstechnologies/archive/2009/12/01/way-to-expose-custom-method-in-an-entity-class-from-wcf-data-service.aspx
Regards,
Fred.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
When i send a photo taken on ipad it appears upside down at addressees but fine on ipad email
when i forward a photo taken on ipad it appears upside down to addressees but fine on my ipad email as a cc copy?
-
Hi All My issues using an Example, I've a power pivot with 3 related tables, (two dimension tables and one measure table), then I created a pivot chart using that 3 tables as source... The pivot chart is a little complex... it takes some time to re
-
I'm getting a NoClassDefFoundError, but the class is in orion.jar! Its javax.servlet.jsp.tagext.TagSupport. There is some code in a jar file (under WEB-INF/lib) that tries to use that class, but apparently can't find it. I'm baffled. I'm not using th
-
Adding all the classes and external jars in webservice WAR using servicegen
Hi, Can someone please tell me how do I include all the classes and my external jar files to the ear/war file that is created using servicegen. I don't see any option in servicegen tag where I can include my classes and jar files to the ear/war file.
-
Ok I bought a 6gb zen micro today. When i opened it from my box, there was a hair between the LCD screen and the glass? ANyway, I can't seem to see a way to take it out. I think it's just under the glass. Any suggestions? What a funny situation..