A simpler solution is to add a hidden boolean parameter to the report, called for example 'IsSubscription' with a default value of false and add the folowing expression to the StartDate and EndDate default values: =IIf(Parameters!IsSubscription.Value, DateAdd("d",-1,Today()), Today())
When running the report normally, the IsSubscription parameter is defaulted to false and the default date is today. When creating the subscription, the IsSubscription parameter must is set to true, thus setting the default value to today-1 = yesterday. This solution can be aplied to do all kinds of changes based on the IsSubscription parameter value and expresions for the rest of the paremeters based on its value. The IsSubscription parameter must be defined before any other parameter that uses its value (moved up in the parameter list).
Alexandru Serban
Posts
-
Creating a dynamic date parameter in a SQL Reporting Services subscription -
Creating a dynamic date parameter in a SQL Reporting Services subscriptionYou can use the following expression: =DateAdd("d",-1,Today())
-
SQL Table DesignAnother is to take your second idea, and just roll it into the Contract table itself. That is, create an FK field for Person, and an FK field for Company, in the Contract table. Yes, this is poor normalization. However, you aren't gaining anything by splitting this out into an Entity table, and you're just increasing the complexity. Well, it is not just the Contracts tabel involved, there are also invoices and all kinds of tabels that store documents and other data that can be applyed to either a persion or a company. And in this case there are only two root tabels but one can imagine a situation that has any number. Adding columns for every one in all the related tabels is not a viable option. The Entity tabel offers a level of abstraction and restricts modifications to a single tabel. Another is to create a pair of intermediary tables. Create a ContractPerson table, that handles contracts to people, and a ContractCompany table, that handles contracts to companies. You would need to add some logic, probably through triggers, to make sure that you don't have the same ContractID in both tables. Again, creating intermediary tabels for every posible case is not a viable option. But, probably your best bet is actually to drop back a step further. What exactly is the practical difference between Persons and Companies? You may want to significantly expand your Entity table to actually be the core of the system. It would include any information that is common to any customer, such as address. You would add a field that indicates if the Entity is a Person, Company, or whatever other categories you might have. You would then make child tables that handle data unique to the type of Entity. Yes, this is the ideea. Entity is the core of the sistem. It links for example the Address table with the specific Person or Company, as a person or a Company can have multiple addresses. So far the best solution is the one I came up the second time, addind a new column in the Entity table for each new table. And not only that, the EntityID equals the value of the column that has the value set(in this case PersonID or CompanyID). That is important because on the data layer I can create a Dataset that has a relation between let's say Person and Address. One is to use triggers on the Person and Company tables to do brute force referential integrity on the EntityID table. I want to restrict as much as possible the use of triggers to enforce referential integr
-
multiple update problem in datagridYou are very ambiguous in describing your "problem" but this is a simple matter of getting your hands on decent ASP.NET book that covers databinding in Webforms.
-
SQL Table DesignHi guys (and girls) I have the folowing situation, a Person table, a Company table and a Contract table. I can make contracts with both persons and companies alike so in the Contract table must be a referece to either a person or a company. In this case there are only two tables that need to link to the Contract table, but lets suppose there can be any number. My initial approach is to create another table let's say Entity that has a column named EntityID that is the PK. In the Person table there is a PersonID column that is a PK for the Person table and a FK from the EntityID in the Entity table. The same applies to the Company table having a CompanyID column that is the PK for the Company table and a FK from the EntityID in the Entity table. The ID columns are GUIDs. I use the EntityID as a FK in the Contract table to link either Person or Company to a contract in a SupplierID and a ClientID column. While this design works, there is a small problem: acidentally deleting either a person or a company can leave an orphaned EntityID with no corespondece to the Person or Company table wich will leave the contract without one of its parts. Is there other database design appropriate for this situation that overcomes this issue using referential integrity? -- modified at 18:18 Wednesday 18th January, 2006 Just came up with another ideea, but it involves creating in the Entity table a new column for each referenced table (in this case Person and Company). In this case PersonID and CompanyID columns will be added to the Entity table and they will be FK from the Person and the Company table, for each Entity row only one of them having a value. After that, the row's EntityID will be used in the Contract table. This works but new columns have to be created for each referenced table. Is there any other solution?
-
Access DeniedNo, I`ve uninstalled it before. ;) I`ve cleaned up the registry of any information regarding this service and it doesn`t exists on the HDD either. I`ve changed the product and upgrade code and still nothing. I have administrative rights, I even give miself rights to act as a part of the operating sistem ;P. The entry in the Application log is:
The description for Event ID ( 11001 ) in Source ( MsiInstaller ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Product: FaxManagementServices -- Error 1001. Access is denied. , (NULL), (NULL), (NULL), (NULL), (NULL), (NULL).
I`ve activated the security audit and apparenty there is not an authentication faliure during the install process. -
Access DeniedHi! I wrote a windows service in C# using the .net clases in VS.NET. It worked fine up until now, when I receive a "Access Denied" error message when I try to install it. I`m using MSI for the installer and I`m running Windows XP SP1. If you have any sugestions, please let me know. Thank You!
-
Setting the "Allow service to interact with desktop" option programaticallyHello to all! I am creating a windows service in C# that will handle fax management tasks (taking them from a database and using the WindowsXP FaxService for sending). To be able to send a fax message, the WinXP FaxService wants a file type that is registered with an aplication that supports the PrintTo verb. I am using Word documents so there is no problem there. The problem is that, to be able to print to the faxservice, my service needs to be able to interact with the desktop (otherwhise Word gets stuck) so I need a way to set the desktop interaction option from the installer itself (MSI) rather than instucting the users in system administrative tasks. I didn`t seem to find a way using the serviceinstaller classes in .NET (C#) Any ideeas ? Thank you!
-
Opening LineWhy don`t you say something like this for an opening line: "I was searching for an opening line, but didn`t seem to find one." This should catch their attention :)
-
Using the WindowsXP FaxService from C#Hello everybody ! I want to use the WindowsXP FaxService COM API in my solution. I`m using Visual Studio .NET I added a reference to the FaxService TypeLibrary in the project and the generated NameSpace is FAXCOMEXLib. Then I wrote the following code:
try { FAXCOMEXLib.FaxServerClass FaxServer=new FAXCOMEXLib.FaxServerClass(); // OK FaxServer.Connect(""); // OK FAXCOMEXLib.FaxFolders FaxFolders=FaxServer.Folders; // NOT OK } catch(Exception ex) { MessageBox.Show(ex.Message); }
After creating the FaxServer object and connecting it to the local FaxService, the Properties that return an object (like Folders,InboundRouting,LoggingOptions) are not valid. There is a {System.InvalidCastException} in the Value of the Autos section in the debugger. Why? Thank you !