I just tried and it seems to work well. Can you attach a sample to show how you move the node?
My code uses simply the code below (you need to select the node before dragging it):
private void treeView1_DragDrop(object sender, DragEventArgs e)
{
var targetNode = e.DropTarget as TreeNode;
if (targetNode != null)
{
var moveNode = e.Data.GetData(typeof(TreeNode)) as TreeNode;
if (moveNode != null)
{
targetNode.Nodes.Add(moveNode);
}
}
}
private void treeView1_DragStart(object sender, EventArgs e)
{
this.treeView1.DoDragDrop(this.treeView1.SelectedNode, DragDropEffects.Move);
}
We don’t use global asax and we don’t use the ASP.NET session. You can use Wisej.Web.Application.Session. It’s a dynamic object. If you need to use the HttpContext you can refer to it using HttpContext.Current. However with WebSocket there is not HttpContext after the first request.
Thanks, logged as #2175. It’s a regression and will be included in the current release build.
So I figured that I needed a javascript callback to get the return value of a webmethod when it is called from the browser:
App.Hello(“Jack”, function(result){ alert(result); });
So I thought I could use that callback from Xamarin.Forms:
webView.EvaluateJavascript(“App.HitFormBackButtonIfPossible();”, new BackButtonAttemptCallback()); //handle the back button behavior we want in WiseJ.
(this successfully calls the WiseJ webmethod.)
And I’ve implemented a javascript value callback that does trigger:
class BackButtonAttemptCallback : Java.Lang.Object, IValueCallback
{
public void OnReceiveValue(Java.Lang.Object result)
{
if (result.ToString() == “False”) {
JavaSystem.Exit(0);
}
}
However, result is always null. Any idea what’s going on?
OK, two things. First, I had to update the function to not crash when OpenForms.Count was zero.
Second, when I execute App.HitBackButtonIfPossible() in the Chrome dev console, it returns undefined. Shouldn’t it be returning true or false? I need to get a result back to the Xamarin app so it knows when there are no open forms, and to tell Xamarin to exit the app. Since we are intercepting the back button in Xamarin, it will not exit the app that way unless we tell it to.
Thanks!
<WebMethod>
Public Shared Function HitFormBackButtonIfPossible()
Dim intMax As Integer = Application.OpenForms.Count
If (intMax > 0) AndAlso (Application.OpenForms(intMax – 1) IsNot Nothing) Then
Dim intCurrentForm As Form = Application.OpenForms(intMax – 1)
‘See if this form has a method called RequestFormClose()
Dim mi As Reflection.MethodInfo = intCurrentForm.GetType().GetMethod(“RequestFormClose”)
If mi IsNot Nothing Then
‘Form has that method. Call it, and let the form handle it.
CallByName(intCurrentForm, “RequestFormClose”, CallType.Method)
Else
‘Form does not contain that method. We will close the form ourselves.
intCurrentForm.DialogResult = DialogResult.Cancel
intCurrentForm.Close()
End If
Return True ‘Indicate a close request was sent/handled
Else
Return False ‘No form found.
End If
End Function
Levi, took a long break from the problem but I think I just got it working.
Instead of creating an inherited form class, I refactored all the back-button code in each form to a new method called RequestFormClose(). Any time a form needs extra processing before closing, we handle it there and always use that name.
In Program.vb’s WebMethod, we get the topmost form, then use Reflection to see if it contains that method (RequestFormClose). If the form does contain the method, we use CallByName() to invoke it, letting the form handle the close code. Otherwise, we simply close it.
All that needs to happen in the Xamarin shell now is to call App.HitFormBackButtonIfPossible() when they hit the Android hardware back-button.
Hope this helps other people.
Oops. I had to make it a Public Shared Function (static).
Shahbaz,
I´d save the PDF stream to a temporary file and use SMTP Client interface to send the email with the temp file attached.
Best regards
Frank
Hi,
reinstalled Wisej, it work!
thanks
Cristian Zebinati
Hi, Frank,
The extra hints helped.
The problem was caused by relocating documents folder from D: drive to C: drive when I had to replace the main HDD.
I had to edit the “Projects and Solutions\Locations” settings for each Visual Studio version to make it point to the current folder..
Thanks
Geoff
I am using the CR Viewer with all my WiseJ apps, and this method works on any Tablet we have used so far. I first populate an XML file on the server with the relevant data (that matches the dataset and rpt file). Then I send the xml file and the rpt file to a SEPERATE asp page (which I call from WiseJ) passing the location of the XML file and the rpt file (GET parameters as part of the URL). See below for various files… (oh, and to save headache, I copy the relevant CR files into a subdirectory on the webserver as well – Had issues with older apps using different versions of CR). Hope these samples help, you will obviously tweak to your own needs.
ReportViewer.asp:
<%@ Page Language=”C#” AutoEventWireup=”true” CodeBehind=”report.aspx.cs” Inherits=”xxxx” %>
<%@ Register assembly=”CrystalDecisions.Web, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304″ namespace=”CrystalDecisions.Web” tagprefix=”CR” %>
<!DOCTYPE html>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head runat=”server”>
<title>Report Display</title>
</head>
<body>
<form id=”report” runat=”server”>
<div>
</div>
<CR:CrystalReportViewer ID=”crystalReportViewer” runat=”server” AutoDataBind=”true” />
</form>
</body>
</html>
ReportViewer.asp.cs:
using System;
using CrystalDecisions.CrystalReports.Engine;
using xxxx;namespace xxxxx
public partial class report : System.Web.UI.Page {
ReportDocument viewerSource = null;protected void Page_Load(object sender, EventArgs e) {
string qsXmlFilename = Request.QueryString[“xfn”];
string qsViewerSource = Request.QueryString[“vs”];
Type t = Type.GetType(qsViewerSource);
viewerSource = (ReportDocument)Activator.CreateInstance(t);xxxx.printSetViewer(viewerSource, qsXmlFilename); // This sub you will have to create to populate – sample provided below
crystalReportViewer.ReportSource = viewerSource;
crystalReportViewer.DisplayStatusbar = false;
crystalReportViewer.DisplayToolbar = true;
crystalReportViewer.EnableDrillDown = false;
crystalReportViewer.EnableDatabaseLogonPrompt = false;
crystalReportViewer.EnableParameterPrompt = false;
crystalReportViewer.EnableToolTips = false;
crystalReportViewer.HasCrystalLogo = false;
crystalReportViewer.HasDrilldownTabs = false;
crystalReportViewer.HasDrillUpButton = false;
crystalReportViewer.HasPageNavigationButtons = true;
crystalReportViewer.HasToggleGroupTreeButton = false;
crystalReportViewer.HasToggleParameterPanelButton = false;
crystalReportViewer.PrintMode = CrystalDecisions.Web.PrintMode.Pdf;
crystalReportViewer.SeparatePages = false;
crystalReportViewer.ShowAllPageIds = false;
crystalReportViewer.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
}Web.config additions:
<configuration>
<configSections>
<sectionGroup name=”businessObjects”>
<sectionGroup name=”crystalReports”>
<section name=”rptBuildProvider” type=”CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null” />
<section name=”crystalReportViewer” type=”System.Configuration.NameValueSectionHandler” />
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource=”true” />
</rptBuildProvider>
<crystalReportViewer>
<add key=”ResourceUri” value=”/crystalreportviewers” /> <!– Set your path to the CR folder on your server –>
</crystalReportViewer>
</crystalReports>
</businessObjects>
Sample of Function:
public static void printSetViewer(ReportDocument objReport, string tmpFile) {
DataSet ds = new DataSet();
ds.ReadXml(tmpFile);
objReport.Load(objReport.FileName.ToString());
objReport.SetDatabaseLogon(“”, “”, tmpFile, ds.DataSetName.ToString());
objReport.SetDataSource(ds);ConnectionInfo crConnInfo = new ConnectionInfo();
crConnInfo.ServerName = tmpFile;
crConnInfo.DatabaseName = ds.DataSetName.ToString();
crConnInfo.UserID = “”;
crConnInfo.Password = “”;
crConnInfo.Type = ConnectionInfoType.MetaData;TableLogOnInfo tblTempLogonInfo = new TableLogOnInfo();
foreach (Table tbl in objReport.Database.Tables) { // CR hates it if you don’t assign login info to Tables in your Dataset
tblTempLogonInfo = tbl.LogOnInfo;
tblTempLogonInfo.ConnectionInfo = crConnInfo;
tblTempLogonInfo.TableName = tbl.Name;
tblTempLogonInfo.ReportName = objReport.Name;
tbl.ApplyLogOnInfo(tblTempLogonInfo);
tbl.Location = tbl.Name;
tbl.SetDataSource(ds.Tables[tbl.ToString()]);
}
}
Hi Geoff,
here you can find a couple more hints:
https://wisej.com/support/question/no-project-templates-available-in-wisej-2-0beta
Best regards
Frank
Hi, Frank,
Still no luck. I have even installed the latest update today.
Template folders and files are where they should be.
In VS 2015, the WiseJ and Wisej2 categories were created. Only the WiseJ category has project type options.
No WiseJ/2 categories or project types appear in VS2017 or 2019
Any further ideas, places to look or steps to take?
Is there a step to perform in the VS environment?
Regards,
Geoff
Hi,
I attach test case
Hi Bernard,
please contact us privately by sending your license key to salesATwisej.com
Best regards
Frank
Hi Florian,
ToolBarButton.ForeColor property is included in the latest Wisej dev build (2.1.41).
Best regards
Frank
I cannot reproduce. Need a small test case. In general, you don’t need to change the Dock property of the TabPage, they are always only docked to fill. And the child form inside the TabPage should not be maximized, set the Dock = Fill for the form.
It’s not possible. Browsers (especially Chrome) do whatever they have decided is best for your users 🙁
Wisej already adds “autocomplete=off” to all input fields. Try to name your password field something other than “password”.
Hi Cristian,
did you check the MergeType of your MenuItems ?
If it still fails, can you please provide a test case ?
Thanks in advance.
Best regards
Frank
