Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3801074
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:59:31+00:00 2026-05-19T13:59:31+00:00

I have tested a web application I have built using MVC 2 on local

  • 0

I have tested a web application I have built using MVC 2 on local servers (both casini and IIS 7.5).
However when I deploy the application to the windows 2008 server standard edition (also running IIS 7.5) I am receiving unexpected results.

The issue is that i have a controller specified to display graphs using Fusion Charts by writing xml data to files.

When the application is deployed, everything works (switching profiles/viewing month-year scale), but when i try to specify a date range the application loads as if nothing happened while making the first xml entry value to a 0.

This does not happen in my local servers, I do not receive any errors at either deployed or local servers.

Here are the relevant part of code that might be able to solve this issue.

The action method:

 public ActionResult Index(string clientProfile, string domainProfile, string period, string sDate, string eDate)
 {
    if (period == "Month")
            {

                if (!string.IsNullOrEmpty(sDate) && !string.IsNullOrEmpty(eDate))
                {
                    var strXML = seoService.GraphForTrafficCountForDomain(clientProfile, sDate, eDate);

                    System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "/FusionCharts/Data/Traffic.xml", strXML);
                }
                else
                {
                    var strXML = seoService.GraphForTrafficCountForDomain(clientProfile);

                    System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "/FusionCharts/Data/Traffic.xml", strXML);
                }
            }
            else if (period == "Year")
            {

                var strXML = seoService.GraphForVisitsCountForDomainGroupByYear(clientProfile);

                System.IO.File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "/FusionCharts/Data/Traffic.xml", strXML);
            }

            return View();
 }

The service function:

public string GraphForTrafficCountForDomain(string domain, string sDate, string eDate)
{
            var profile = profileService.GetProfileByDomain(domain, null);

            string strXML = "";

            var StartingDate = DateTime.Parse(sDate);
            var EndingDate = DateTime.Parse(eDate);

            var data =
           repository.FindAll<TrafficData>(x => x.ProfileId == profile.Id && x.Date >= StartingDate && x.Date <= EndingDate).OrderByDescending(d => d.Date).ToList();

            strXML += @"<?xml version=""1.0"" encoding=""utf-8"" ?>";
            strXML += @"<graph caption="""" subcaption="""" xAxisName=""Month"" yAxisName=""Traffic"" decimalPrecision=""0"" formatNumberScale=""0"">";

            for (DateTime date = StartingDate; date.Date <= EndingDate; date = date.AddMonths(1))
            {
                var startDate = new DateTime(date.Year, date.Month, 1);
                var endDate = new DateTime(date.AddMonths(1).Year, date.AddMonths(1).Month, 1).AddDays(-1);

                int value = 0;
                if (data.Any(x => x.Date >= startDate && x.Date <= endDate))
                {
                    value = data.Where(x => x.Date >= startDate && x.Date <= endDate).Select(d => d.TrafficCount).Sum();
                }

                strXML += String.Format(@"<set name=""{0}"" value=""{1}"" hoverText=""{2}""/>",
                                           date.ToString("MM-yy"), (value == 0) ? "0" : value.ToString(),
                                           (value == 0) ? "0" : value.ToString() + " " + date.ToString("MM-yy"));
            }

            strXML += @"</graph>";

            return strXML;
}

I am also attaching an image containing the correct output and the wrong output.

Output Image

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:59:32+00:00Added an answer on May 19, 2026 at 1:59 pm

    The issue was differences between server culture for some reason (even when the server is hosted at the same country as i reside).

    the DateTime Object was not parsing correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Asp.net MVC2 web application. I built the application using VS2008 and
I have tested all my systems developed in Delphi (in Windows XP) on Wine
I have this regex I built and tested in regex buddy. _ [ 0-9]{10}+
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a web-based system built with user login data based on session variables.
My application I have an application design that looks like this: web application layer
I have a visual studio solution with an ASP.NET 3.5 web application (WCF host)
I'm trying to deploy an application to Tomcat 7 on a Windows server. I
I have a Rails app that I have successfully tested with Mongrel and Webkit.
Should simple JavaBeans that have only simple getters and setters be unit tested?? What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.