Change invoice pdf file name dynamics d365 - x++

can someone help me how to change the file name of a invoice ?
WHen I export a pdf file from screen it always saves as 'show invoice' and in pdf its psaprojinvoice.myprecisiondesign. But I want that there is Invoice num.
Where might be the problem here?
class ProjInvoiceControllerSZM extends PSAProjAndContractInvoiceController
{
public static ProjInvoiceControllerSZM construct()
{
return new ProjInvoiceControllerSZM();
}
public static void main(Args _args)
{
SrsReportRunController formLetterController = ProjInvoiceControllerSZM::construct();
ProjInvoiceControllerSZM controller = formLetterController;
srsPrintDestinationSettings srsPrintDestinationSettings;
controller.initArgs(_args);
Controller.parmReportName(ssrsReportStr(PSAProjInvoiceSZM, PrecisionDesign1));
PSAProjInvoiceContract rdpContract = new PSAProjInvoiceContract();
SRSPrintDestinationSettings settings;
// Define report and report design to use
controller.parmReportName(ssrsReportStr(PSAProjInvoiceSZM, PrecisionDesign1));
// Use execution mode appropriate to your situation
controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
// Suppress report dialog
controller.parmShowDialog(false);
// Explicitly provide all required parameters
// rdpContract.parmReportStateDate(systemDateGet());
controller.parmReportContract().parmRdpContract(rdpContract);
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
settings.printMediumType(SRSPrintMediumType::File);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.fileName('Invoice.pdf');
// Execute the report
// controller.startOperation();
formLetterController.startOperation();
}
protected void outputReport()
{
SRSCatalogItemName reportDesign;
reportDesign = ssrsReportStr(PSAProjInvoiceSZM,PrecisionDesign1);
this.parmReportName(reportDesign);
this.parmReportContract().parmReportName(reportDesign);
formletterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);
super();
}
}

Related

How do I manually add extra textview without adding it in axml

i am trying to extract one data at a time from the sqlite database from the application and for every data return from the sqlite table,i will need to output the data into the GUI with every textview created for every return result else will throw message not found. i am using xamarin native android.
How do i achieve that,i am new to xamarin?
e.g i have a textedit for user to input values database table values(1,2,3,4) if user puts 1,there will be a textview below the textedit with value 1 created And if user continue to put 2,another textview below (the textview with value 1) will be created with value 2
E.G Below:
1)Edittext for user input
2)When user input values 1 in the editbox,it matches the values in the database and return the value 1 as below:
3)When user input another value 2 in the editbox,it matches the values in the database and return value 2 as below:
Cuurently,my code is as follows:
DB.cs(to create the sqlite database in a folder in android that i can access instead of the default application folder)
namespace TestApp
{
public static class Db
{
public static string DBFile = testPath.Combine(Android.OS.Environment.DirectoryDownloads, "test.db"); //for tmp use
public static List<Model.Test> TestList = new List<Model.Test>();
public static void InitializeLocalDB()
{
if (!File.Exists(Db.DBFile))
{
using (var connection = new SQLiteConnection(Db.DBFile))
{
connection.DropTable<Model.Test>();
connection.CreateTable<Model.Test>();
}
}
}
}
}
MainActivity.cs
namespace TestApp
{
[Activity(Label = "#string/app_name", Theme = "#style/AppTheme", MainLauncher = true)]
public class MainActivity : AppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.activity_main);
Db.InitializeLocalDB();
}
Once i am able to create the database in the download folder,i will extract the db file and manually add in data with compactview to test the app.

using config.groovy in gwt for user preference

I have a gwt and grails legacy app that I'm upgrading and modifying.. Its a reservation calendar basically with different "views".. the problem I'm having is I want the user to be able to choose a default view for themselves upon logging in..I've done this with a grails only application before but gwt is much different..how can I pass something from config.groovy to the gwt part that select which view to show..and this view isn't a view like a grails view..think of it like restaurants..and a user may only want to see the reservations for a particular restaurant instead of the default of all restaurants
Maybe not a direct answer to your question but you can just make a ordinary GWT remote service UserPreferencesService which will store user preferences
public interface UserPreferencesService extends RemoteService {
List<Restaurant> getRestaurants(Account user);
void setRestaurants(Account user, List<Restaurant> restaurants);
}
In your entry point you can then make a decision on what kind of view you'll show to user
public final class Application implements EntryPoint {
private AuthServiceAsync authService =
GWT.create(AuthService.class);
private UserPreferencesAsync preferencesService =
GWT.create(UserPreferencesService.class);
#Override
public void onModuleLoad() {
// handle login
authService.getAccount(new Callback<Account>() {
#Override
public void onSuccess(final Account account) {
// check if user have a preferred restourants
preferencesService.getRestaurants(account,
new Callback<Account>() {
#Override
public void onSuccess(final List<Restaurant> restaurants) {
// user did not select any restaurants yet.
// Show a selection widget
if (restaurants.isEmpty) {
RestaurantSelectorWidget widget =
new RestaurantSelectorWidget();
// your custom handler here
widget.addHandler(new Handler() {
#Override
public void onSelected(/*...*/) {
// save user preferences
// and switch to normal view
}
})
RootPanel.get("container")
.add(widget);
} else {
// show normal view
}
}
}
}
}
}
}
}
Also you may take look to this plugin which is adds GWT support to grails.

Load Test method threw exception System.NullReferenceException: Object reference not set to an instance of an object

I created the following Web Coded UI test for my web application.
When executed the test case works successfully.
When the test case is added as part of a "Load test" it starts throwing error messages.
Test Error TestError 4 Test method testWithSQLExp.CodedUITest2.CodedUITestMethod1 threw exception:
System.NullReferenceException: Object reference not set to an instance of an object.
BTW the same Load test with the same codedUI test work good when the user count is set to 1.
my code is as follows
UIMap.cs
public void AssertMethod1()
{
#region Variable Declarations
HtmlCell uIItem1363758Cell = this.UIFirstNetHomePageWindWindow.UIEConnectFirstMeritBaDocument1.UIMainContent_gvAccounTable.UIItem1363758Cell;
#endregion
// Verify that the 'InnerText' property of '$13,637.58' cell equals '$13,637.58'
Assert.AreEqual(this.AssertMethod1ExpectedValues.UIItem1363758CellInnerText, uIItem1363758Cell.InnerText);
}
public void RecordedMethod1()
{
#region Variable Declarations
HtmlEdit uICompanyEdit = this.UIFirstNetHomePageWindWindow.UIBusinessDocument.UICompanyEdit;
HtmlEdit uIUsernameEdit = this.UIFirstNetHomePageWindWindow.UIBusinessDocument.UIUsernameEdit;
HtmlEdit uITxtPasswordEdit = this.UIFirstNetHomePageWindWindow.UIEConnectFirstMeritBaDocument.UITxtPasswordEdit;
#endregion
// Go to web page 'https://dev.firstmerit.com/business/index.html' using new browser instance
this.UIFirstNetHomePageWindWindow.LaunchUrl(new System.Uri(this.RecordedMethod1Params.UIFirstNetHomePageWindWindowUrl));
// Type 'demo' in 'Company' text box
uICompanyEdit.Text = this.RecordedMethod1Params.UICompanyEditText;
// Type '{Tab}' in 'Company' text box
Keyboard.SendKeys(uICompanyEdit, this.RecordedMethod1Params.UICompanyEditSendKeys, ModifierKeys.None);
// Type 'user' in 'Username' text box
uIUsernameEdit.Text = this.RecordedMethod1Params.UIUsernameEditText;
// Type '{Enter}' in 'Username' text box
Keyboard.SendKeys(uIUsernameEdit, this.RecordedMethod1Params.UIUsernameEditSendKeys, ModifierKeys.None);
// Type '********' in 'txtPassword' text box
uITxtPasswordEdit.Password = this.RecordedMethod1Params.UITxtPasswordEditPassword;
// Type '{Enter}' in 'txtPassword' text box
Keyboard.SendKeys(uITxtPasswordEdit, this.RecordedMethod1Params.UITxtPasswordEditSendKeys, ModifierKeys.None);
}
CodedUITest2.cs
namespace testWithSQLExp
{
[CodedUITest]
public class CodedUITest2
{
public CodedUITest2()
{
}
[TestMethod]
public void CodedUITestMethod1()
{
// To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
// For more information on generated code, see http://go.microsoft.com/fwlink/?LinkId=179463
this.UIMap.RecordedMethod1();
this.UIMap.AssertMethod1();
}
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
private TestContext testContextInstance;
public UIMap UIMap
{
get
{
if ((this.map == null))
{
this.map = new UIMap();
}
return this.map;
}
}
private UIMap map;
}
}
found the answer..
msdn code UI limitation - http://msdn.microsoft.com/en-us/library/ff468125.aspx
Coded UI Test Limitations in Load Tests
Coded UI Tests drive the mouse and keyboard. Therefore, only 1 virtual user can run coded UI tests per agent. The best way to control this is to set up a separate scenario in the load test, and set the user load to 1 user.

Writing via content pipeline in Xbox game project

I'm creating an Xbox application and I have this problem with the content pipeline.
Loading .xnb files is not a problem but I can't seem to find any helpful tutorials on writing via the content pipeline. I want to write an XML whenever the user presses a custom made "save" button.
I've searched the web for "saving game sate" etc. but so far I haven't found a solution for my case.
So, summarized: is there a way to write data (in XML format) via the content pipeline, if my Save() method is called?
Saving and loading during an XNA game involves a series of asynchronous method calls. You'll find the objects you need in the Microsoft.Xna.Framework.Storage namespace.
Specifically, you need a StorageDevice and a StorageContainer;
private static StorageDevice mStorageDevice;
private static StorageContainer mStorageContainer;
To Save:
public static void SaveGame()
{
// Call this static method to begin the process; SaveGameDevice is another method in your class
StorageDevice.BeginShowSelector(SaveGameDevice, null);
}
// this will be called by XNA sometime after your call to BeginShowSelector
// SaveGameContainer is another method in your class
private static void SaveGameDevice(IAsyncResult pAsyncResult)
{
mStorageDevice = StorageDevice.EndShowSelector(pAsyncResult);
mStorageDevice.BeginOpenContainer("Save1", SaveGameContainer, null);
}
// this method does the actual saving
private static void SaveGameContainer(IAsyncResult pAsyncResult)
{
mStorageContainer = mStorageDevice.EndOpenContainer(pAsyncResult);
if (mStorageContainer.FileExists("save.dat"))
mStorageContainer.DeleteFile("save.dat");
// in my case, I have a BinaryWriter wrapper that I use to perform the save
BinaryWriter writer = new BinaryWriter(new System.IO.BinaryWriter(mStorageContainer.CreateFile("save.dat")));
// I save the gamestate by passing the BinaryWriter
GameProgram.GameState.SaveBinary(writer);
// then I close the writer
writer.Close();
// clean up
mStorageContainer.Dispose();
mStorageContainer = null;
}
Loading is very similar:
public static void LoadGame()
{
StorageDevice.BeginShowSelector(LoadGameDevice, null);
}
private static void LoadGameDevice(IAsyncResult pAsyncResult)
{
mStorageDevice = StorageDevice.EndShowSelector(pAsyncResult);
mStorageDevice.BeginOpenContainer("Save1", LoadGameContainer, null);
}
private static void LoadGameContainer(IAsyncResult pAsyncResult)
{
mStorageContainer = mStorageDevice.EndOpenContainer(pAsyncResult))
// this is my wrapper of BinaryReader which I use to perform the load
BinaryReader reader = null;
// the file may not exist
if (mStorageContainer.FileExists("save.dat"))
{
reader = new BinaryReader(new System.IO.BinaryReader(mStorageContainer.OpenFile("save.dat", FileMode.Open)));
// pass the BinaryReader to read the data
GameProgram.LoadGameState(reader);
reader.Close();
}
// clean up
mStorageContainer.Dispose();
mStorageContainer = null;
}

C# .net windows application - Printing Text Box Values

I have two text boxes when i input in these text boxes , by clicking the print button , it should directly printed with the connected printer. can anybody help me how should i do this?
The example below is a basic idea of using/inheriting the PrintDocument class:
using System.Drawing.Printing;
public class PrintDoc : PrintDocument
{
// there are other properties you can enter here
// for instance, page orientation, size, font, etc.
private string textout;
public string PrintText
{
get { return textout; }
set { textout = value; }
}
// you will also need to add any appropriate class ctor
// experiment with the PrintDocument class to learn more
}
Then from your form's button event, call something like:
public void PrintDocument()
{
//instance PrintDocument class
PrintDoc printer = new PrintDoc();
//set PrintText
printer.PrintText = myTextBox.Text;
printer.Print(); // very straightforward
}

Resources